From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward500b.mail.yandex.net (forward500b.mail.yandex.net [178.154.239.144]) by sourceware.org (Postfix) with ESMTPS id A7EF13858D28 for ; Sun, 14 Jan 2024 19:35:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A7EF13858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A7EF13858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.154.239.144 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705260908; cv=none; b=hyCCTAp4zzk2uPyAonem9nN3grRL+CEBQBLUp8CQxG5owRKfq1KsKsNAT0SIu2ObWQiJYzmo+XpH272qPrPIJNR42lG4tlHzfMMztWYjLbe3r31nLCLcui/PizC65AwRnlL63bvxLocuJs6vjhUW3oFrd0L2QQmyaWJptUn+jBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705260908; c=relaxed/simple; bh=U2rhKRaSSWBbcJURkse3LC9/xIEj3tyXQjWCwF0MYWo=; h=DKIM-Signature:Date:From:Message-ID:To:Subject:MIME-Version; b=njWnir2//UQ8ALCQCYzkU+BnGIxZ1ZHn8Qfvx5ioHDjcsWMmV7yby18pEdVK3Ltvk7R67nGE8OwhrPLwmtc4ctanDz49zEk+2BIZHzMsMIaz3HpmQHxn1RbibkUcEshROMKlbqDE55Fo7rm0A9MJtgli9txRl9wvsnf8rh3+Qwk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-nwsmtp-smtp-production-main-25.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-25.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:2e14:0:640:2cd1:0]) by forward500b.mail.yandex.net (Yandex) with ESMTP id 20AB360CC0 for ; Sun, 14 Jan 2024 22:35:04 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-25.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 1ZsYwJCAPqM0-KcQ7HpCK; Sun, 14 Jan 2024 22:35:03 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1705260903; bh=74qp15U9lfdxT+SJTIGD0NlFQkHJGuJVyPZLMH2PWl4=; h=In-Reply-To:Subject:Date:References:To:Message-ID:Reply-To:From; b=t3cH8Dt+Tz3UZBox1Q2GampOU3drXPQo9tgd/QcRd2LPKjvAG3kFj6cUnC4wpSMUY HXv2XnVWY7x28P1AEvxTxJ0G4UiTc+aoNJq1HLxnw27G5ngaoQOW/69iFhzEYwz+LN HQV2VXJkfxX+pDFvWoq4xtVu+GS1fVejOgeXWh4A= Authentication-Results: mail-nwsmtp-smtp-production-main-25.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Sun, 14 Jan 2024 19:23:26 -0000 Date: Sun, 14 Jan 2024 22:23:26 +0300 From: Andrey Repin X-Mailer: The Bat! (v9.3.4) Professional Reply-To: cygwin@cygwin.com Message-ID: <229633151.20240114222326@yandex.ru> To: Brian Inglis via Cygwin , cygwin@cygwin.com Subject: Re: Capturing a Cygwin instance from another PC In-Reply-To: <7b39e912-1cf4-4ab7-b3a4-c0973d186594@Shaw.ca> References: <09578ac85d3f64c90f2b6610545bd8dc@plebeian.com> <87plzvd2ok.fsf@> <7b39e912-1cf4-4ab7-b3a4-c0973d186594@Shaw.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_THEBAT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,XM_LIGHT_HEAVY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Greetings, Brian Inglis via Cygwin! >> 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 Been struck by the same situation (though, in a less distributed environment - I've had to move Cygwin installation from one partition to another), I went with a simple sed script: >> sed -Ee '/ 1$/s/^([^[:space:]]+) [^[:space:]]+?(\.tar[^[:space:]]+ 1)$/\1 \1-0\2/; t; d;' < installed.db In essence: - for each line that ends with "1" (for packages, that were manually installed), replace version string with "0"; - if replacement was successful, go to next line; - delete line. Once I made sure the script is right, I just appended its output to the end of installed.db on target partition. Then run setup.exe and everything happened according to plan. This works for v3 database, so to be on a safe side, run setup once on the source machine to update installation and database to the latest version. -- With best regards, Andrey Repin Sunday, January 14, 2024 22:15:59 Sorry for my terrible english...