mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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 in65ffb9388c
. 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 because65ffb9388c
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.
This commit is contained in:
parent
09676b7c11
commit
ccda88a070
2 changed files with 14 additions and 1 deletions
|
@ -196,6 +196,16 @@ EOF
|
|||
guix package --bootstrap -p "$profile" -i gcc-bootstrap
|
||||
installed="`guix package -p "$profile" -I | cut -f1`"
|
||||
|
||||
# Dry-run upgrade. Make sure no new generation is created when things are
|
||||
# already in store and '-n' is used: <https://issues.guix.gnu.org/53267>.
|
||||
V_MINOR=0
|
||||
export V_MINOR
|
||||
profile_before="$(readlink "$profile")"
|
||||
guix package -p "$profile" --bootstrap -L "$module_dir" -u # build the profile
|
||||
guix package -p "$profile" --roll-back
|
||||
guix package -p "$profile" --bootstrap -L "$module_dir" -u . -n # check '-n'
|
||||
test "$(readlink "$profile")" = "$profile_before"
|
||||
|
||||
for i in 1 2
|
||||
do
|
||||
V_MINOR="$i"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue