'guix package --upgrade' is now the same as "guix package --upgrade=''". --- Hi!
On #guix, we discussed the idea that "--upgrade" should not always require an argument. When upgrading the whole system, "package --upgrade" feels natural, maybe even more than "package --upgrade=''". Here is a patch that implements that. I'm not sure that it is a very beautiful piece of Guile code; comment are welcome! Cyril. guix/scripts/package.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index ac99d16..8d666b9 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -328,7 +328,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (display (_ " -r, --remove=PACKAGE remove PACKAGE")) (display (_ " - -u, --upgrade=REGEXP upgrade all the installed packages matching REGEXP")) + -u, --upgrade[=REGEXP] upgrade all the installed packages matching REGEXP")) (display (_ " --roll-back roll back to the previous generation")) (newline) @@ -379,7 +379,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (option '(#\r "remove") #t #f (lambda (opt name arg result) (alist-cons 'remove arg result))) - (option '(#\u "upgrade") #t #f + (option '(#\u "upgrade") #f #f (lambda (opt name arg result) (alist-cons 'upgrade arg result))) (option '("roll-back") #f #f @@ -602,7 +602,9 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (let* ((installed (manifest-packages (profile-manifest profile))) (upgrade-regexps (filter-map (match-lambda (('upgrade . regexp) - (make-regexp regexp)) + (if regexp + (make-regexp regexp) + (make-regexp ""))) (_ #f)) opts)) (upgrade (if (null? upgrade-regexps) -- 1.7.10.4