Capturing a Cygwin instance from another PC

Brian Inglis Brian.Inglis@Shaw.ca
Mon Nov 27 17:43:54 GMT 2023


On 2023-11-27 01:24, ASSI via Cygwin wrote:
> Chris Wagner via Cygwin writes:
>> If you just want to duplicate the package selection this trick is all
>> you need.
>> 1. Get the current list: cygcheck -cd |perl -ane '$\=","; print $F[0]'
>> 2. Ignore the "Cygwin,Package" at the front.
>> 3. Copy all that and put it as the command line argument to setup.exe -P

> That will lose the information about which packages were installed by
> explicit user request vs. installed as a dependency.

What that means is the complete information is only available in:

	/etc/setup/installed.db

which has header:

	INSTALLED.DB 3

then a list of installed packages in which each line specifies 3 fields:

	NAME NAME-VERSION-RELEASE.tar.bz2 MANUALLY_PICKED_FLAG

in that 2nd field .tar.bz2 is the historically available download format but 
only VERSION-RELEASE is now significant, and the only packages you should be 
selecting to install are those which have a 3rd field manually picked flag == 1 
as the others with 0 are automatically installed dependencies e.g.

$ awk '1 < FNR && /1/ == $3 { printf( "%s ", $1) }; END { printf( "\n" ) }' \
	~/cygwin-64t/etc/setup/installed.db | wc
       1      52     686
$ grep -c '\s0$' ~/cygwin-64t/etc/setup/installed.db
364
$ awk '1 < FNR && /1/ == $3 { printf( "%s ", $1) }; END { printf( "\n" ) }' \
	~/cygwin-64/etc/setup/installed.db | wc
       1     884   12124
$ grep -c '\s0$' ~/cygwin-64/etc/setup/installed.db
1638

so from 2-7 times as many packages as manually picked could be dependencies 
automatically installed.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin mailing list