summaryrefslogtreecommitdiff
path: root/guix/scripts/package.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-10-01 17:10:49 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-10-01 17:10:49 -0400
commit2e65e4834a226c570866f2e8976ed7f252b45cd1 (patch)
tree21d625bce8d03627680214df4a6622bf8eb79dc9 /guix/scripts/package.scm
parent9c68ecb24dd1660ce736cdcdea0422a73ec318a2 (diff)
parentf1a3c11407b52004e523ec5de20d326c5661681f (diff)
Merge remote-tracking branch 'origin/master' into staging
With resolved conflicts in: gnu/packages/bittorrent.scm gnu/packages/databases.scm gnu/packages/geo.scm gnu/packages/gnupg.scm gnu/packages/gstreamer.scm gnu/packages/gtk.scm gnu/packages/linux.scm gnu/packages/python-xyz.scm gnu/packages/xorg.scm guix/build/qt-utils.scm
Diffstat (limited to 'guix/scripts/package.scm')
-rw-r--r--guix/scripts/package.scm48
1 files changed, 29 insertions, 19 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index e3d40d5142..a34ecdcb54 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -831,15 +832,14 @@ processed, #f otherwise."
(map profile-manifest profiles)))
(installed (manifest-entries manifest)))
(leave-on-EPIPE
- (for-each (match-lambda
- (($ <manifest-entry> name version output path _)
- (when (or (not regexp)
- (regexp-exec regexp name))
- (format #t "~a\t~a\t~a\t~a~%"
- name (or version "?") output path))))
-
- ;; Show most recently installed packages last.
- (reverse installed))))
+ (let ((rows (filter-map
+ (match-lambda
+ (($ <manifest-entry> name version output path _)
+ (and (regexp-exec regexp name)
+ (list name (or version "?") output path))))
+ installed)))
+ ;; Show most recently installed packages last.
+ (pretty-print-table (reverse rows)))))
#t)
(('list-available regexp)
@@ -862,16 +862,15 @@ processed, #f otherwise."
result))
'())))
(leave-on-EPIPE
- (for-each (match-lambda
- ((name version outputs location)
- (format #t "~a\t~a\t~a\t~a~%"
- name version
- (string-join outputs ",")
- (location->string location))))
- (sort available
- (match-lambda*
- (((name1 . _) (name2 . _))
- (string<? name1 name2))))))
+ (let ((rows (map (match-lambda
+ ((name version outputs location)
+ (list name version (string-join outputs ",")
+ (location->string location))))
+ (sort available
+ (match-lambda*
+ (((name1 . _) (name2 . _))
+ (string<? name1 name2)))))))
+ (pretty-print-table rows)))
#t))
(('list-profiles _)
@@ -1044,6 +1043,17 @@ processed, #f otherwise."
(warn-about-old-distro)
+ (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
+ ;; "guix upgrade" on an up-to-date profile). We cannot distinguish
+ ;; among these here; all we can say is that there's nothing to do.
+ (warning (G_ "nothing to do~%")))
+
(unless (manifest-transaction-null? trans)
;; When '--manifest' is used, display information about TRANS as if we
;; were starting from an empty profile.