Msys2/pacman: list dependencies with versions

Here is a one-liner to list all the dependencies for an Msys2 package, or for any pacman based system for that matter:

$ pactree -u mingw-w64-x86_64-gcc | xargs -r pacman -Si | gawk '/^Name *:/ {name=$3} /^Version *:/ {version=$3; printf "%s-%s\n",name,version}'
mingw-w64-x86_64-gcc-7.2.0-1
mingw-w64-x86_64-binutils-2.29.1-1
mingw-w64-x86_64-libiconv-1.15-1
mingw-w64-x86_64-zlib-1.2.11-1
mingw-w64-x86_64-bzip2-1.0.6-6
mingw-w64-x86_64-gcc-libs-7.2.0-1
mingw-w64-x86_64-gmp-6.1.2-1
mingw-w64-x86_64-mpc-1.0.3-2
mingw-w64-x86_64-mpfr-3.1.6-1
mingw-w64-x86_64-libwinpthread-git-5.0.0.4850.d1662dc7-1
mingw-w64-x86_64-crt-git-5.0.0.5002.34a7c1c0-1
mingw-w64-x86_64-headers-git-5.0.0.5002.34a7c1c0-1
mingw-w64-x86_64-isl-0.18-1
mingw-w64-x86_64-windows-default-manifest-6.4-3
mingw-w64-x86_64-winpthreads-git-5.0.0.4850.d1662dc7-1

Note: on my system, it works only for installed packages, even using the “-s” option:

$ pacman -Si mingw-w64-i686-qtwebkit
Repository      : mingw32
Name            : mingw-w64-i686-qtwebkit
...

$ pactree -s mingw-w64-i686-qtwebkit
error: package 'mingw-w64-i686-qtwebkit' not found

I don’t know why.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s