Subject: [PATCH 1/1] upgrade: Allow several regexps.

From: zimoun <[email-masked]>
Date: Sat, 28 Nov 2020 21:32:45 +0100

Fixes <https://bugs.gnu.org/44928>.
Reported by Luis Felipe <[email-masked]>.

* guix/scripts/upgrade.scm (guix-upgrade): Allow several regexps and remove
"extraneous arguement" check.
---
 guix/scripts/upgrade.scm | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/guix/scripts/upgrade.scm b/guix/scripts/upgrade.scm
index dcbcb2ab09..0eaae01e46 100644
--- a/guix/scripts/upgrade.scm
+++ b/guix/scripts/upgrade.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019, 2020 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2020 Jakub Kądziołka <[email-masked]>
+;;; Copyright © 2020 Simon Tournier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -76,13 +77,9 @@ This is an alias for 'guix package -u'.\n"))
   (define (handle-argument arg result arg-handler)
     ;; Accept at most one non-option argument, and treat it as an upgrade
     ;; regexp.
-    (match (assq-ref result 'upgrade)
-      (#f
-       (values (alist-cons 'upgrade arg
-                           (alist-delete 'upgrade result))
+    (values (alist-cons 'upgrade arg
+                           (delete '(upgrade . #f) result))
                arg-handler))
-      (_
-       (leave (G_ "~A: extraneous argument~%") arg))))
 
   (define opts
     (parse-command-line args %options
-- 
2.29.2