diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 617e102d93..d8b80efe8e 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2013, 2015 Mark H Weaver ;;; Copyright © 2014, 2016 Alex Kost @@ -247,11 +247,15 @@ (define (find-packages-by-description regexps) description matches at least one of REGEXPS sorted by relevance, and the list of relevance scores." (let ((matches (fold-packages (lambda (package result) - (match (package-relevance package regexps) - ((? zero?) - result) - (score - (cons (list package score) result)))) + (if (package-superseded package) + result + (match (package-relevance package + regexps) + ((? zero?) + result) + (score + (cons (list package score) + result))))) '()))) (unzip2 (sort matches (lambda (m1 m2) diff --git a/tests/guix-package.sh b/tests/guix-package.sh index ffc8c64e24..760a2e4c9b 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès # Copyright © 2013 Nikita Karetnikov # # This file is part of GNU Guix. @@ -118,6 +118,22 @@ grep '^name: gnubg' "$tmpfile" rm -f "$tmpfile" +# Make sure deprecated packages don't show up: . +mkdir "$module_dir" +cat > "$module_dir/foo.scm"< /dev/null