diff options
author | Leo Famulari <leo@famulari.name> | 2016-10-26 18:59:28 -0400 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2016-10-26 19:00:06 -0400 |
commit | 02c73adcdf0f29dbecd9a1bb3c9be3626cd5dea9 (patch) | |
tree | fb8fadc87f5b82dc35f44831af8b79eec37887b3 /guix/scripts | |
parent | a19da40630138acea7169491a6926e00cf7d301b (diff) | |
parent | 5d73e3000030006b00e7e6644f3ced5d6176376e (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/package.scm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index b87aee0be9..70ed0a7ea6 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -3,6 +3,8 @@ ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2013, 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014, 2016 Alex Kost <alezost@gmail.com> +;;; Copyright © 2016 Roel Janssen <roel@gnu.org> +;;; Copyright © 2016 Benz Schenk <benz.schenk@uzh.ch> ;;; ;;; This file is part of GNU Guix. ;;; @@ -667,24 +669,30 @@ processed, #f otherwise." ((head tail ...) head)))) (match (assoc-ref opts 'query) (('list-generations pattern) - (define (list-generation number) + (define (list-generation display-function number) (unless (zero? number) (display-generation profile number) - (display-profile-content profile number) + (display-function profile number) (newline))) - + (define (diff-profiles profile numbers) + (unless (null-list? (cdr numbers)) + (display-profile-content-diff profile (car numbers) (cadr numbers)) + (diff-profiles profile (cdr numbers)))) (cond ((not (file-exists? profile)) ; XXX: race condition (raise (condition (&profile-not-found-error (profile profile))))) ((string-null? pattern) - (for-each list-generation (profile-generations profile))) + (list-generation display-profile-content + (car (profile-generations profile))) + (diff-profiles profile (profile-generations profile))) ((matching-generations pattern profile) => (lambda (numbers) (if (null-list? numbers) (exit 1) (leave-on-EPIPE - (for-each list-generation numbers))))) + (list-generation display-profile-content (car numbers)) + (diff-profiles profile numbers))))) (else (leave (_ "invalid syntax: ~a~%") pattern))) |