summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-09-26 00:20:11 +0200
committerLudovic Courtès <ludo@gnu.org>2013-09-26 00:20:11 +0200
commit7facbf2b58f80afffedbb9230ec7ab9b61232dfe (patch)
tree7ab3870f77f596e548ccd0e50f5ea16d1c32f434 /guix
parent1fa49a2c4636c0f35972c16f6bd2d28a4424b821 (diff)
parent834b5c80763eba42018606a674bcc53bfeca10eb (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r--guix/packages.scm4
-rw-r--r--guix/scripts/package.scm27
2 files changed, 20 insertions, 11 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index efec414675..9433fe9586 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -462,8 +462,8 @@ system identifying string)."
#:outputs outputs #:system system
(args))))))))
-(define* (package-output store package output
- #:optional (system (%current-system)))
+(define* (package-output store package
+ #:optional (output "out") (system (%current-system)))
"Return the output path of PACKAGE's OUTPUT for SYSTEM---where OUTPUT is the
symbolic output name, such as \"out\". Note that this procedure calls
`package-derivation', which is costly."
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 1d00e39540..66505f172f 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -955,12 +955,16 @@ more information.~%"))
(match (assoc-ref opts 'query)
(('list-generations pattern)
(define (list-generation number)
- (begin
- (format #t (_ "Generation ~a\t~a~%") number
- (date->string
- (time-utc->date
- (generation-time profile number))
- "~b ~d ~Y ~T"))
+ (unless (zero? number)
+ (let ((header (format #f (_ "Generation ~a\t~a") number
+ (date->string
+ (time-utc->date
+ (generation-time profile number))
+ "~b ~d ~Y ~T")))
+ (current (generation-number profile)))
+ (if (= number current)
+ (format #t (_ "~a\t(current)~%") header)
+ (format #t "~a~%" header)))
(for-each (match-lambda
((name version output location _)
(format #t " ~a\t~a\t~a\t~a~%"
@@ -977,11 +981,16 @@ more information.~%"))
(leave (_ "profile '~a' does not exist~%")
profile))
((string-null? pattern)
- (for-each list-generation
- (generation-numbers profile)))
+ (let ((numbers (generation-numbers profile)))
+ (if (equal? numbers '(0))
+ (exit 1)
+ (for-each list-generation numbers))))
((matching-generations pattern profile)
=>
- (cut for-each list-generation <>))
+ (lambda (numbers)
+ (if (null-list? numbers)
+ (exit 1)
+ (for-each list-generation numbers))))
(else
(leave (_ "invalid syntax: ~a~%")
pattern)))