guix package: Do not say "nothing to do" upon rollback & co.
authorLudovic Courtès <ludo@gnu.org>
Sun, 13 Jun 2021 21:46:17 +0000 (23:46 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sun, 13 Jun 2021 21:57:45 +0000 (23:57 +0200)
Previously, "guix package --switch-generations=4" or similar would print
"nothing to do".

* guix/scripts/package.scm (process-actions): Do not warn about "nothing
to do" when one of %ACTIONS is requested.

guix/scripts/package.scm

index 6db8380..694959d 100644 (file)
@@ -1044,7 +1044,10 @@ processed, #f otherwise."
 
       (warn-about-old-distro)
 
-      (when (and (null? files) (manifest-transaction-null? trans))
+      (when (and (null? files) (manifest-transaction-null? trans)
+                 (not (any (match-lambda
+                             ((key . _) (assoc-ref %actions key)))
+                           opts)))
         ;; We can reach this point because the user did not specify any action
         ;; (as in "guix package"), did not specify any package (as in "guix
         ;; install"), or because there's nothing to upgrade (as when running