about summary refs log tree commit diff
path: root/tests/user-envs.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-03-10T10·24+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-03-10T10·24+0000
commit4ada6db1fc9cee9c0e51fb54af8770dd28243dff (patch)
tree0e83b2219f0aa3a2c4fd012f196bbc8ecdf29102 /tests/user-envs.sh
parent9811815429f613b4ab64794a3b95144f9aa5b41d (diff)
* `nix-env -q' now accepts arguments that allow specific derivations
  to be queried, e.g., `nix-env -qa firefox'.  This does require the
  argument '*' to be passed if one wants information about all
  derivations, so the old `nix-env -qa' now is `nix-env -qa "*"'.

Diffstat (limited to 'tests/user-envs.sh')
-rw-r--r--tests/user-envs.sh44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/user-envs.sh b/tests/user-envs.sh
index debba74ff223..8d5756f77d72 100644
--- a/tests/user-envs.sh
+++ b/tests/user-envs.sh
@@ -6,19 +6,19 @@ profiles="$NIX_STATE_DIR"/profiles
 test "$($nixenv -p $profiles/test -q | wc -l)" -eq 0
 
 # Query available: should contain several.
-test "$($nixenv -p $profiles/test -f ./user-envs.nix -qa | wc -l)" -eq 5
+test "$($nixenv -p $profiles/test -f ./user-envs.nix -qa '*' | wc -l)" -eq 5
 
 # Install "foo-1.0".
 $nixenv -p $profiles/test -f ./user-envs.nix -i foo-1.0
 
 # Query installed: should contain foo-1.0 now (which should be
 # executable).
-test "$($nixenv -p $profiles/test -q | wc -l)" -eq 1
-$nixenv -p $profiles/test -q | grep -q foo-1.0
+test "$($nixenv -p $profiles/test -q '*' | wc -l)" -eq 1
+$nixenv -p $profiles/test -q '*' | grep -q foo-1.0
 test "$($profiles/test/bin/foo)" = "foo-1.0"
 
 # Store the path of foo-1.0.
-outPath10=$($nixenv -p $profiles/test -q --out-path --no-name | grep foo-1.0)
+outPath10=$($nixenv -p $profiles/test -q --out-path --no-name '*' | grep foo-1.0)
 echo "foo-1.0 = $outPath10"
 test -n "$outPath10"
 
@@ -26,20 +26,20 @@ test -n "$outPath10"
 $nixenv -p $profiles/test -f ./user-envs.nix -i foo-2.0pre1
 
 # Query installed: should contain foo-2.0pre1 now.
-test "$($nixenv -p $profiles/test -q | wc -l)" -eq 1
-$nixenv -p $profiles/test -q | grep -q foo-2.0pre1
+test "$($nixenv -p $profiles/test -q '*' | wc -l)" -eq 1
+$nixenv -p $profiles/test -q '*' | grep -q foo-2.0pre1
 test "$($profiles/test/bin/foo)" = "foo-2.0pre1"
 
 # Upgrade "foo": should install foo-2.0.
 $nixenv -p $profiles/test -f ./user-envs.nix -u foo
 
 # Query installed: should contain foo-2.0 now.
-test "$($nixenv -p $profiles/test -q | wc -l)" -eq 1
-$nixenv -p $profiles/test -q | grep -q foo-2.0
+test "$($nixenv -p $profiles/test -q '*' | wc -l)" -eq 1
+$nixenv -p $profiles/test -q '*' | grep -q foo-2.0
 test "$($profiles/test/bin/foo)" = "foo-2.0"
 
 # Store the path of foo-2.0.
-outPath20=$($nixenv -p $profiles/test -q --out-path --no-name | grep foo-2.0)
+outPath20=$($nixenv -p $profiles/test -q --out-path --no-name '*' | grep foo-2.0)
 test -n "$outPath20"
 
 # Install bar-0.1, uninstall foo.
@@ -47,18 +47,18 @@ $nixenv -p $profiles/test -f ./user-envs.nix -i bar-0.1
 $nixenv -p $profiles/test -f ./user-envs.nix -e foo
 
 # Query installed: should only contain bar-0.1 now.
-if $nixenv -p $profiles/test -q | grep -q foo; then false; fi
-$nixenv -p $profiles/test -q | grep -q bar
+if $nixenv -p $profiles/test -q '*' | grep -q foo; then false; fi
+$nixenv -p $profiles/test -q '*' | grep -q bar
 
 # Rollback: should bring "foo" back.
 $nixenv -p $profiles/test --rollback
-$nixenv -p $profiles/test -q | grep -q foo-2.0
-$nixenv -p $profiles/test -q | grep -q bar
+$nixenv -p $profiles/test -q '*' | grep -q foo-2.0
+$nixenv -p $profiles/test -q '*' | grep -q bar
 
 # Rollback again: should remove "bar".
 $nixenv -p $profiles/test --rollback
-$nixenv -p $profiles/test -q | grep -q foo-2.0
-if $nixenv -p $profiles/test -q | grep -q bar; then false; fi
+$nixenv -p $profiles/test -q '*' | grep -q foo-2.0
+if $nixenv -p $profiles/test -q '*' | grep -q bar; then false; fi
 
 # Count generations.
 test "$($nixenv -p $profiles/test --list-generations | wc -l)" -eq 5
@@ -66,7 +66,7 @@ test "$($nixenv -p $profiles/test --list-generations | wc -l)" -eq 5
 # Install foo-1.0, now using its store path.
 echo $outPath10
 $nixenv -p $profiles/test -i "$outPath10"
-$nixenv -p $profiles/test -q | grep -q foo-1.0
+$nixenv -p $profiles/test -q '*' | grep -q foo-1.0
 
 # Delete all old generations.
 $nixenv -p $profiles/test --delete-generations old
@@ -79,12 +79,12 @@ if test -e "$outPath20"; then false; fi
 
 # Uninstall everything
 $nixenv -p $profiles/test -f ./user-envs.nix -e '*'
-test "$($nixenv -p $profiles/test -q | wc -l)" -eq 0
+test "$($nixenv -p $profiles/test -q '*' | wc -l)" -eq 0
 
 # Installing "foo" should only install the newest foo.
 $nixenv -p $profiles/test -f ./user-envs.nix -i foo
-test "$($nixenv -p $profiles/test -q | grep foo- | wc -l)" -eq 1
-$nixenv -p $profiles/test -q | grep -q foo-2.0
+test "$($nixenv -p $profiles/test -q '*' | grep foo- | wc -l)" -eq 1
+$nixenv -p $profiles/test -q '*' | grep -q foo-2.0
 
 # On the other hand, this should install both (and should fail due to
 # a collision).
@@ -94,6 +94,6 @@ if $nixenv -p $profiles/test -f ./user-envs.nix -i foo-1.0 foo-2.0; then false;
 # Installing "*" should install one foo and one bar.
 $nixenv -p $profiles/test -f ./user-envs.nix -e '*'
 $nixenv -p $profiles/test -f ./user-envs.nix -i '*'
-test "$($nixenv -p $profiles/test -q | wc -l)" -eq 2
-$nixenv -p $profiles/test -q | grep -q foo-2.0
-$nixenv -p $profiles/test -q | grep -q bar-0.1.1
+test "$($nixenv -p $profiles/test -q '*' | wc -l)" -eq 2
+$nixenv -p $profiles/test -q '*' | grep -q foo-2.0
+$nixenv -p $profiles/test -q '*' | grep -q bar-0.1.1