aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2016-10-26 18:59:28 -0400
committerLeo Famulari <leo@famulari.name>2016-10-26 19:00:06 -0400
commit02c73adcdf0f29dbecd9a1bb3c9be3626cd5dea9 (patch)
treefb8fadc87f5b82dc35f44831af8b79eec37887b3 /guix
parenta19da40630138acea7169491a6926e00cf7d301b (diff)
parent5d73e3000030006b00e7e6644f3ced5d6176376e (diff)
downloadgnu-guix-02c73adcdf0f29dbecd9a1bb3c9be3626cd5dea9.tar
gnu-guix-02c73adcdf0f29dbecd9a1bb3c9be3626cd5dea9.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r--guix/import/cran.scm4
-rw-r--r--guix/scripts/package.scm18
-rw-r--r--guix/ui.scm28
3 files changed, 43 insertions, 7 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index f9369414cd..e839af5de2 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -111,11 +111,11 @@ package definition."
(define %cran-url "http://cran.r-project.org/web/packages/")
(define %bioconductor-url "http://bioconductor.org/packages/")
-;; The latest Bioconductor release is 3.3. Bioconductor packages should be
+;; The latest Bioconductor release is 3.4. Bioconductor packages should be
;; updated together.
(define %bioconductor-svn-url
(string-append "https://readonly:readonly@"
- "hedgehog.fhcrc.org/bioconductor/branches/RELEASE_3_3/"
+ "hedgehog.fhcrc.org/bioconductor/branches/RELEASE_3_4/"
"madman/Rpacks/"))
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)))
diff --git a/guix/ui.scm b/guix/ui.scm
index eb85df3b18..9af8648211 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -7,6 +7,8 @@
;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
+;;; Copyright © 2016 Benz Schenk <benz.schenk@uzh.ch>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -87,6 +89,7 @@
matching-generations
display-generation
display-profile-content
+ display-profile-content-diff
roll-back*
switch-to-generation*
delete-generation*
@@ -1070,6 +1073,31 @@ DURATION-RELATION with the current time."
(format #t (_ "~a\t(current)~%") header)
(format #t "~a~%" header)))))
+(define (display-profile-content-diff profile gen1 gen2)
+ "Display the changed packages in PROFILE GEN2 compared to generation GEN2."
+
+ (define (equal-entry? first second)
+ (string= (manifest-entry-item first) (manifest-entry-item second)))
+
+ (define (display-entry entry prefix)
+ (match entry
+ (($ <manifest-entry> name version output location _)
+ (format #t " ~a ~a\t~a\t~a\t~a~%" prefix name version output location))))
+
+ (define (list-entries number)
+ (manifest-entries (profile-manifest (generation-file-name profile number))))
+
+ (define (display-diff profile old new)
+ (display-generation profile new)
+ (let ((added (lset-difference
+ equal-entry? (list-entries new) (list-entries old)))
+ (removed (lset-difference
+ equal-entry? (list-entries old) (list-entries new))))
+ (for-each (cut display-entry <> "+") added)
+ (for-each (cut display-entry <> "-") removed)))
+
+ (display-diff profile gen1 gen2))
+
(define (display-profile-content profile number)
"Display the packages in PROFILE, generation NUMBER, in a human-readable
way."