build: Make sure tests/guix-package.sh doesn't leave anything behind it.

Fixes a regression introduced in commit 300868ba.

* tests/guix-package.sh: Move 'module_dir' definition to the top, and
  "rm -rf" it from the top-most 'trap'.  Remove second use of 'trap'.
This commit is contained in:
Ludovic Courtès 2014-10-10 14:08:47 +02:00
parent 7313a52e7a
commit e25234e34b
1 changed files with 2 additions and 3 deletions

View File

@ -28,10 +28,11 @@ readlink_base ()
basename `readlink "$1"`
}
module_dir="t-guix-package-$$"
profile="t-profile-$$"
rm -f "$profile"
trap 'rm "$profile" "$profile-"[0-9]* ; rm -rf t-home-'"$$" EXIT
trap 'rm "$profile" "$profile-"[0-9]* ; rm -rf "$module_dir" t-home-'"$$" EXIT
# Use `-e' with a non-package expression.
if guix package --bootstrap -e +;
@ -257,9 +258,7 @@ guix package -I | head -1 2> "$HOME/err2"
test "`cat "$HOME/err1" "$HOME/err2"`" = ""
# Make sure '-L' extends the package module search path.
module_dir="t-guix-package-$$"
mkdir "$module_dir"
trap "rm -rf $module_dir" EXIT
cat > "$module_dir/foo.scm"<<EOF
(define-module (foo)