From patchwork Sun Feb 27 13:53:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37518 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D0C5327BBEA; Sun, 27 Feb 2022 14:03:00 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 740C127BBE9 for ; Sun, 27 Feb 2022 14:03:00 +0000 (GMT) Received: from localhost ([::1]:42376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOK8Z-00044M-KN for patchwork@mira.cbaines.net; Sun, 27 Feb 2022 09:02:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOK11-0000Xi-5v for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOK0x-0001to-Gu for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOK0x-0004uw-G0 for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:07 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54180] [PATCH 07/12] tests: Make sure 'guix home reconfigure' backs up files. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 13:55:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54180@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 54180-submit@debbugs.gnu.org id=B54180.164597007118775 (code B ref 54180); Sun, 27 Feb 2022 13:55:07 +0000 Received: (at 54180) by debbugs.gnu.org; 27 Feb 2022 13:54:31 +0000 Received: from localhost ([127.0.0.1]:57180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOK0M-0004sf-MP for submit@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOK0A-0004qH-Ps for 54180@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:25 -0500 Received: from [2001:470:142:3::e] (port=50240 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOJzw-0001Zc-Mf; Sun, 27 Feb 2022 08:54:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=rUm49j68/EWeFH8IeWP5cuqsDExkhaRgEo7KyXRQJD0=; b=rUy7dXm2drVZZuu6Z47v CdZhn4dqkLxD3/wV5YTKhDeNjX7MpFHXtDZdyvVMgta1LxhL0+ErNIiut1B1G4wFUh+UNQ5sHqEKJ 6GM0GZyl/JVIwmle8o4TEejPs6jjMFxBTbNcyeJC/tu0Y06uvYZRIgBXlNNKFs0DjuW4HqbnlbA5l wXO1/5r1l7q0/b04bptGXMUQftgXjRtrgoe+2mIy8NX9sYOJQ/GaAbbdE0I0y5NCvSzxbKSo32//H AmPEZDKekeI8QDMWroRIoNJvwGH8tDPrCBSLr75ZihGNjaSWpuC9zqBlf0iTWvdvXj/n7IVC1ngX+ YPUp7PrD4BPv5w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55804 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOJzw-0007Pg-8Q; Sun, 27 Feb 2022 08:54:04 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sun, 27 Feb 2022 14:53:37 +0100 Message-Id: <20220227135342.10296-7-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220227135342.10296-1-ludo@gnu.org> References: <20220227135342.10296-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * tests/guix-home.sh: Create ~/.bashrc and ~/.config/test.conf prior to 'reconfigure' and check whether they were backed up. --- tests/guix-home.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/guix-home.sh b/tests/guix-home.sh index e578559c97..ae3e52c9e1 100644 --- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -1,7 +1,7 @@ - # GNU Guix --- Functional package management for GNU # Copyright © 2021 Andrew Tropin # Copyright © 2021 Oleg Pykhalov +# Copyright © 2022 Ludovic Courtès # # This file is part of GNU Guix. # @@ -54,7 +54,12 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT # Test 'guix home reconfigure'. # - printf "# dot-bashrc test file for guix home" > "dot-bashrc" + echo "# This file will be overridden and backed up." > "$HOME/.bashrc" + mkdir "$HOME/.config" + echo "This file will be overridden too." > "$HOME/.config/test.conf" + echo "This file will stay around." > "$HOME/.config/random-file" + + echo -n "# dot-bashrc test file for guix home" > "dot-bashrc" cat > "home.scm" <<'EOF' (use-modules (guix gexp) @@ -100,6 +105,13 @@ EOF # the content of bashrc-test-config.sh" grep -q "the content of ~/.config/test.conf" "${HOME}/.config/test.conf" + # This one should still be here. + grep "stay around" "$HOME/.config/random-file" + + # Make sure preexisting files were backed up. + grep "overridden" "$HOME"/*guix-home*backup/.bashrc + grep "overridden" "$HOME"/*guix-home*backup/.config/test.conf + # # Test 'guix home describe'. #