DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 479AL5QQ1087377 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=NVFUAyP0 X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F187385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1723198863; bh=OWoIvlVdMyN/utNqumMLhrnHjg6RrOYQz/yPL3aMv0w=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=NVFUAyP0FFxBSZChS0cxp3feR0EYI02nLxp6BgR2qfrrmQRj7hOLYbyOV2K0xX5HP CoY/CuRz8Ukm4mybHFMBeDN4QEq958d4igrtTE+dZA3D2QBFh7aVmr7hW+K77HHMpP 6u4jUgTeJaALkRF0ubnaQ4FAvOl9ApxtD7dZ+TgM= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 311B63858C3A ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 311B63858C3A ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723198806; cv=none; b=T4DvhuqHDr7BbeRDddi57jOqyotU5RnIsYcNqvjrjrlQ2v2X3jBTR65/9VGd3mTa2SDLwgEUbdW9W/fgFdtceykXliWz5+WeT5v/lSlqZaEKV4oqyWNUj1DWGHhR4nx/DBev9ml0Ndom7kvSibQ3mJzK7/4rXBpo9W94E/IGwxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723198806; c=relaxed/simple; bh=+MEr2hM87Aqpmk09xrEdJZbrgFC9a+6LBkzFLaVBOX8=; h=DKIM-Signature:Date:From:Message-ID:To:Subject:MIME-Version; b=S/vr5fNUZVA5+FQNEre7V2WsSEhEnxIesliclSGMBOhHeM1uK2ilI+QCq/ZzAJS+9A695jcw+Jy7SW5z0LamiQ0xCjieVsKyZgLTYBg9KGM4+QRJwcQewLuNirDENRzOYq32z+OrVHsu2eukXx4uOtHx21+uQ/+0ObDdu9e0lB0= ARC-Authentication-Results: i=1; server2.sourceware.org X-Yandex-Fwd: 1 Date: Fri, 9 Aug 2024 13:06:31 +0300 X-Mailer: The Bat! (v9.3.4) Professional Message-ID: <798132057.20240809130631@yandex.ru> To: David Karr , cygwin AT cygwin DOT com Subject: Re: How to repair the symlinks in a copied cygwin64 tree In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrey Repin via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Andrey Repin Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Greetings, David Karr! > At my work, I had to have my laptop reimagined for various reasons. I had > them save my cygwin64 tree to external storage first. I now have the laptop > back, and I copied the entire tree back in, but now I realize I should have > done this differently, and I'm wondering how best to repair this. Some of > you can probably guess, but now all of the files that were symlinks in > Cygwin are now very small data files. I can tell they used to be symlinks > because when I cat one, it shows "!" in the first characters. These symlinks usually point to Cygwin directory tree and should be fine. Just chmod +S them. > What is the best strategy for repairing this? The most simple-minded > approach that I can see is simply renaming the cygwin64 tree to get it out > of the way, and then just reinstalling Cygwin, and then copying in all the > files in my cygwin home directory in the saved tree. I will likely guess > wrong on what packages I had installed before. Is there some way I can > simply repair the symylink files directly? Easiest I've encountered is to 0. Have a backup of your existing installation, for reference. 1. Install Cygwin anew. 2. Pull /etc/setup/installed.db from backup into a temporary directory. 3. Get a list of manually installed packages from backup # sed -Ee '/ 1$/s/^([^[:space:]]+) [^[:space:]]+?(\.tar[^[:space:]]+ 1)$/\1 \1-0\2/; t; d;' < $backup/installed.db Warning note: There will be failures, not all package versions adhere to the same pattern. 4. Append the list to the end of current /etc/setup/installed.db 5. Run setup to pull the package "updates". > Besides the symlink problem, is there anything else that I might have > broken by doing it this way? None that I know. > I'm guessing the correct way to have done this would have been instead > storing the "tar czpf" output in external storage. I think that would have > preserved the symlinks and restored them properly with "tar xzf". It would have a chance of destroying permissions, I prefer reinstall, with backup of /etc/ and /usr/local directories (that's where I keep custom stuff). Since I don't use Cygwin's /home, it's easy for me. -- With best regards, Andrey Repin Friday, August 9, 2024 12:54:41 Sorry for my terrible english... -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple