From 01afdab89c6a91f4cd05d3c4f4ff95a0402703eb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Sep 2016 23:14:07 +0200 Subject: packages: Add 'package-superseded' and associated support. This provides a way to mark a package as superseded by another one. Upgrades replace superseded packages with their replacement. * guix/packages.scm (package-superseded, deprecated-package): New procedures. * gnu/packages.scm (%find-package): Check for 'package-superseded'. * guix/scripts/package.scm (transaction-upgrade-entry)[supersede]: New procedure. Call it when 'package-superseded' is true. * tests/guix-build.sh: Add test for a superseded package. * tests/packages.scm ("package-superseded") ("transaction-upgrade-entry, superseded package"): New tests. --- gnu/packages.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages.scm b/gnu/packages.scm index 68a9eef2ad..5d60423a3a 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -305,7 +305,14 @@ (define* (%find-package spec name version #:key fallback?) (when fallback? (warning (_ "deprecated NAME-VERSION syntax; \ use NAME@VERSION instead~%"))) - pkg) + + (match (package-superseded pkg) + ((? package? new) + (info (_ "package '~a' has been superseded by '~a'~%") + (package-name pkg) (package-name new)) + new) + (#f + pkg))) (_ (if version (leave (_ "~A: package not found for version ~a~%") name version) -- cgit v1.2.3