aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimoun <zimon.toutoune@gmail.com>2020-11-28 21:32:45 +0100
committerMathieu Othacehe <othacehe@gnu.org>2020-12-01 11:34:10 +0100
commit86971616c139597ffa9e20acc75533ff90176450 (patch)
treef5a96e0c9ca82864cce4b023488c18958492f955
parentdcb95c6fc1cee5a74146f4f062d83a8f8c8d4cd0 (diff)
downloadguix-86971616c139597ffa9e20acc75533ff90176450.tar
guix-86971616c139597ffa9e20acc75533ff90176450.tar.gz
upgrade: Allow several regexps.
Fixes <https://bugs.gnu.org/44928>. Reported by Luis Felipe <luis.felipe.la@protonmail.com>. * guix/scripts/upgrade.scm (guix-upgrade): Allow several regexps and remove "extraneous arguement" check. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
-rw-r--r--guix/scripts/upgrade.scm14
1 files changed, 5 insertions, 9 deletions
diff --git a/guix/scripts/upgrade.scm b/guix/scripts/upgrade.scm
index dcbcb2ab09..beb59cbe6f 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 <ludo@gnu.org>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -74,15 +75,10 @@ This is an alias for 'guix package -u'.\n"))
(synopsis "upgrade packages to their latest version")
(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))
- arg-handler))
- (_
- (leave (G_ "~A: extraneous argument~%") arg))))
+ ;; Treat non-option arguments as upgrade regexps.
+ (values (alist-cons 'upgrade arg
+ (delete '(upgrade . #f) result))
+ arg-handler))
(define opts
(parse-command-line args %options