guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: tests: 'guix-gc.sh' passes even when 'out' or 'drv' are defined a


From: Ludovic Courtès
Subject: 01/01: tests: 'guix-gc.sh' passes even when 'out' or 'drv' are defined as env vars.
Date: Mon, 13 Nov 2017 04:10:22 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit ff23b47dbee038236386ddc2ed2fff4c77ad3aa1
Author: Ludovic Courtès <address@hidden>
Date:   Mon Nov 13 09:58:47 2017 +0100

    tests: 'guix-gc.sh' passes even when 'out' or 'drv' are defined as env vars.
    
    This fixes a test failure exhibited by
    fb17a89912c2a3738dae716e30481c11e1c6f0ac whereby assignments to 'out' in
    guix-gc.sh would go to the 'out' environment variable, when it exists,
    which in turn prevents garbage collection of $out.
    
    * tests/guix-gc.sh: Add 'unset' invocations.
---
 tests/guix-gc.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/guix-gc.sh b/tests/guix-gc.sh
index a100f18..57c5e7d 100644
--- a/tests/guix-gc.sh
+++ b/tests/guix-gc.sh
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2013, 2015 Ludovic Courtès <address@hidden>
+# Copyright © 2013, 2015, 2017 Ludovic Courtès <address@hidden>
 #
 # This file is part of GNU Guix.
 #
@@ -25,6 +25,14 @@ guix gc --version
 trap "rm -f guix-gc-root" EXIT
 rm -f guix-gc-root
 
+# Below we are using 'drv' and 'out' to contain store file names.  If 'drv'
+# and 'out' are environment variables, 'list-runtime-roots' will "see" them
+# and thus prevent $drv and $out from being garbage-collected.  Using 'unset'
+# allows us to make sure these are truly local shell variables and not
+# environments variables.
+unset drv
+unset out
+
 # For some operations, passing extra arguments is an error.
 for option in "" "-C 500M" "--verify" "--optimize"
 do



reply via email to

[Prev in Thread] Current Thread [Next in Thread]