pondělí 10. června 2013

Create independent distribution of certain cygwin utility

In some cases you can find some cygwin utility useful for windows and you don't want or can't fully install cygwin. There is a handy utility called cygcheck which you can use to extract information about  certain cygwin executable dependencies. You can use the information to create standalone distribution directory of the utility. Following command extracts xmllint utility into /tmp/distro with all dependant DLLs.

mkdir /tmp/distro && cygcheck $(which xmllint) | \
grep cygwin |sed -e "s/^ \\+//" | \
cygpath -f - | \
while read x; do cp -v $x /tmp/distro; done