package: Honor '--dry-run' when target profile is already in store.
authorLudovic Courtès <ludo@gnu.org>
Wed, 19 Jan 2022 21:01:35 +0000 (22:01 +0100)
committerLudovic Courtès <ludo@gnu.org>
Wed, 19 Jan 2022 21:07:54 +0000 (22:07 +0100)
commitccda88a07039c62d5d0bfde7fccef02ef3937ccf
treebf509b8f898cde9fbcc8039e7609d7286b572873
parent09676b7c11a785ef117ad328f3eca2ffa24795e8
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.
guix/scripts/package.scm
tests/guix-package-net.sh