From 94a400bebae48aebc35fb84aa0b134b25ce46e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 26 Jun 2017 22:02:24 +0200 Subject: import cran: Generate a valid 'license' field for "GPL". Fixes . Reported by Joshua Sierles . * guix/import/cran.scm (string->license) <"GPL">: Return a quoted list. --- guix/import/cran.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 8d963a7475..056a7dcc7c 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -69,7 +69,7 @@ ("BSD_2_clause + file LICENSE" 'bsd-2) ("BSD_3_clause" 'bsd-3) ("BSD_3_clause + file LICENSE" 'bsd-3) - ("GPL" (list 'gpl2+ 'gpl3+)) + ("GPL" '(list gpl2+ gpl3+)) ("GPL (>= 2)" 'gpl2+) ("GPL (>= 3)" 'gpl3+) ("GPL-2" 'gpl2) -- cgit v1.2.3 From 6d382339de1c9fbe20ec056fb5200d5724a4aa44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 26 Jun 2017 22:23:11 +0200 Subject: profiles: Add 'manifest-transaction-removal-candidate?'. * guix/profiles.scm (manifest-transaction-removal-candidate?): New procedure. * tests/profiles.scm ("manifest-transaction-removal-candidate?"): New test. --- guix/profiles.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix') diff --git a/guix/profiles.scm b/guix/profiles.scm index dcb5186c7a..056406e303 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -96,6 +96,7 @@ manifest-transaction-install-entry manifest-transaction-remove-pattern manifest-transaction-null? + manifest-transaction-removal-candidate? manifest-perform-transaction manifest-transaction-effects @@ -564,6 +565,12 @@ remove software." (($ () ()) #t) (($ _ _) #f))) +(define (manifest-transaction-removal-candidate? entry transaction) + "Return true if ENTRY is a candidate for removal in TRANSACTION." + (any (lambda (pattern) + ((entry-predicate pattern) entry)) + (manifest-transaction-remove transaction))) + (define (manifest-transaction-effects manifest transaction) "Compute the effect of applying TRANSACTION to MANIFEST. Return 4 values: the list of packages that would be removed, installed, upgraded, or downgraded -- cgit v1.2.3 From fc8fdcf56ecc159cb4e85ffdde60a54c4fa5c04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 26 Jun 2017 22:48:57 +0200 Subject: guix package: 'guix package -r PKG -u' does not upgrade PKG. Fixes . Reported by Mark H Weaver . * guix/scripts/package.scm (transaction-upgrade-entry): Check if ENTRY matches 'manifest-transaction-removal-candidate?' and return TRANSACTION if it does. (process-actions): Move 'options->removable' from step 2 to step 1. --- guix/scripts/package.scm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 1f835ca5a5..400623d41b 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -294,7 +294,11 @@ of relevance scores." (output (manifest-entry-output old))) transaction))) - (match entry + (match (if (manifest-transaction-removal-candidate? entry transaction) + 'dismiss + entry) + ('dismiss + transaction) (($ name version output (? string? path)) (match (vhash-assoc name (find-newest-available-packages)) ((_ candidate-version pkg . rest) @@ -875,11 +879,11 @@ processed, #f otherwise." #:dry-run? dry-run?))))) opts) - ;; Then, process normal package installation/removal/upgrade. + ;; Then, process normal package removal/installation/upgrade. (let* ((manifest (profile-manifest profile)) - (step1 (options->installable opts manifest - (manifest-transaction))) - (step2 (options->removable opts manifest step1)) + (step1 (options->removable opts manifest + (manifest-transaction))) + (step2 (options->installable opts manifest step1)) (step3 (manifest-transaction (inherit step2) (install (map transform-entry -- cgit v1.2.3 From 0040140d34fc12c5205d806c5e8dfee627cb1b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 26 Jun 2017 22:51:14 +0200 Subject: guix package: Allow '--rollback', after all. * guix/scripts/package.scm (%options): Add "rollback" as an alias for "roll-back". --- guix/scripts/package.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 400623d41b..58da3113a0 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -496,7 +496,7 @@ Install, remove, or upgrade packages in a single transaction.\n")) (alist-cons 'do-not-upgrade arg result) result) arg-handler)))) - (option '("roll-back") #f #f + (option '("roll-back" "rollback") #f #f (lambda (opt name arg result arg-handler) (values (alist-cons 'roll-back? #t result) #f))) -- cgit v1.2.3