mirror of
https://github.com/NixOS/nix
synced 2025-07-10 04:43:53 +02:00
Merge pull request #12275 from andrewhamon/ah/set-priority-nix-env-install
nix-env: add a --priority flag to --install
This commit is contained in:
commit
17b6557c03
3 changed files with 39 additions and 14 deletions
|
@ -173,13 +173,21 @@ nix-env -q '*' | grepQuiet bar-0.1.1
|
|||
|
||||
# Test priorities: foo-0.1 has a lower priority than foo-1.0, so it
|
||||
# should be possible to install both without a collision. Also test
|
||||
# ‘--set-flag priority’ to manually override the declared priorities.
|
||||
# '-i --priority' and '--set-flag priority' to manually override the
|
||||
# declared priorities.
|
||||
nix-env -e '*'
|
||||
nix-env -i foo-0.1 foo-1.0
|
||||
[ "$($profiles/test/bin/foo)" = "foo-1.0" ]
|
||||
nix-env --set-flag priority 1 foo-0.1
|
||||
[ "$($profiles/test/bin/foo)" = "foo-0.1" ]
|
||||
|
||||
# Priorities can be overridden with the --priority flag
|
||||
nix-env -e '*'
|
||||
nix-env -i foo-1.0
|
||||
[ "$($profiles/test/bin/foo)" = "foo-1.0" ]
|
||||
nix-env -i --priority 1 foo-0.1
|
||||
[ "$($profiles/test/bin/foo)" = "foo-0.1" ]
|
||||
|
||||
# Test nix-env --set.
|
||||
nix-env --set $outPath10
|
||||
[ "$(nix-store -q --resolve $profiles/test)" = $outPath10 ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue