diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2022-01-19 22:01:35 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2022-01-19 22:07:54 +0100 |
| commit | ccda88a07039c62d5d0bfde7fccef02ef3937ccf (patch) | |
| tree | bf509b8f898cde9fbcc8039e7609d7286b572873 /tests | |
| parent | 09676b7c11a785ef117ad328f3eca2ffa24795e8 (diff) | |
package: Honor '--dry-run' when target profile is already in store.
Fixes <https://issues.guix.gnu.org/53267>.
Reported by Tirifto <tirifto@posteo.cz>.
Regression introduced in 65ffb9388c1c3d870cb07e4cb3ef12c9ac06a161.
In the (unlikely) case where the profile we're targeting with "guix
upgrade -n" or similar is already built, a new profile generation would
be created and linked to despite the use of '-n'. This is because
65ffb9388c1c3d870cb07e4cb3ef12c9ac06a161 assumed that dry-run behavior
would be handled solely by the build handler, which is not the case when
there's nothing to build.
* guix/scripts/package.scm (build-and-use-profile): Reintroduce #:dry-run?
and honor it.
(process-actions): Pass #:dry-run? to 'build-and-use-profile'.
* tests/guix-package-net.sh: Add test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/guix-package-net.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh index a3beb238fe8..1cdeff773a3 100644 --- a/tests/guix-package-net.sh +++ b/tests/guix-package-net.sh | |||
| @@ -196,6 +196,16 @@ EOF | |||
| 196 | guix package --bootstrap -p "$profile" -i gcc-bootstrap | 196 | guix package --bootstrap -p "$profile" -i gcc-bootstrap |
| 197 | installed="`guix package -p "$profile" -I | cut -f1`" | 197 | installed="`guix package -p "$profile" -I | cut -f1`" |
| 198 | 198 | ||
| 199 | # Dry-run upgrade. Make sure no new generation is created when things are | ||
| 200 | # already in store and '-n' is used: <https://issues.guix.gnu.org/53267>. | ||
| 201 | V_MINOR=0 | ||
| 202 | export V_MINOR | ||
| 203 | profile_before="$(readlink "$profile")" | ||
| 204 | guix package -p "$profile" --bootstrap -L "$module_dir" -u # build the profile | ||
| 205 | guix package -p "$profile" --roll-back | ||
| 206 | guix package -p "$profile" --bootstrap -L "$module_dir" -u . -n # check '-n' | ||
| 207 | test "$(readlink "$profile")" = "$profile_before" | ||
| 208 | |||
| 199 | for i in 1 2 | 209 | for i in 1 2 |
| 200 | do | 210 | do |
| 201 | V_MINOR="$i" | 211 | V_MINOR="$i" |
