diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-03-30 23:34:48 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-03-31 00:06:36 +0200 |
commit | a357849f5b1314c2a35efeee237645b9b08c39f5 (patch) | |
tree | 847d1d851d8c28d26deb6295634d296fe83aa80a /tests/packages.scm | |
parent | b9c79cae53f5f828e078ac5aafc2d80fa3204aae (diff) | |
download | gnu-guix-a357849f5b1314c2a35efeee237645b9b08c39f5.tar gnu-guix-a357849f5b1314c2a35efeee237645b9b08c39f5.tar.gz |
guix package: Do not misdiagnose upgrades when there are propagated inputs.
Fixes <https://bugs.gnu.org/35872>.
Reported by Andy Tai <atai@atai.org>.
* guix/profiles.scm (list=?, manifest-entry=?): New procedures.
* guix/scripts/package.scm (transaction-upgrade-entry): In the '=' case,
use 'manifest-entry=?' to determine whether it's an upgrade.
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades,
propagated inputs"): New test.
Diffstat (limited to 'tests/packages.scm')
-rw-r--r-- | tests/packages.scm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm index d0befbe45d..7a8b5e4a2d 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -122,6 +122,28 @@ (manifest-transaction))))) (manifest-transaction-null? tx))) +(test-assert "transaction-upgrade-entry, zero upgrades, propagated inputs" + ;; Properly detect equivalent packages even when they have propagated + ;; inputs. See <https://bugs.gnu.org/35872>. + (let* ((dep (dummy-package "dep" (version "2"))) + (old (dummy-package "foo" (version "1") + (propagated-inputs `(("dep" ,dep))))) + (drv (package-derivation %store old)) + (tx (mock ((gnu packages) find-best-packages-by-name + (const (list old))) + (transaction-upgrade-entry + %store + (manifest-entry + (inherit (package->manifest-entry old)) + (item (derivation->output-path drv)) + (dependencies + (list (manifest-entry + (inherit (package->manifest-entry dep)) + (item (derivation->output-path + (package-derivation %store dep))))))) + (manifest-transaction))))) + (manifest-transaction-null? tx))) + (test-assert "transaction-upgrade-entry, one upgrade" (let* ((old (dummy-package "foo" (version "1"))) (new (dummy-package "foo" (version "2"))) |