mirror of
git://git.savannah.gnu.org/guix.git
synced 2023-12-14 03:33:07 +01:00
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>
This commit is contained in:
parent
dcb95c6fc1
commit
86971616c1
1 changed files with 5 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue