diff options
author | Mark H Weaver <mhw@netris.org> | 2018-02-16 13:14:26 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2018-02-16 13:14:26 -0500 |
commit | 150062f19060687dbf8e2cbe6a22c2f8600e7c4e (patch) | |
tree | 4c25afac34832d118407180d66121f1a2f0c761d /guix | |
parent | 54a93355c22ab533743cd948cf7b57993c789686 (diff) | |
parent | 6a3cf4e6c7d77634d67902215f0017c12455c6fb (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build/union.scm | 2 | ||||
-rw-r--r-- | guix/import/utils.scm | 12 | ||||
-rw-r--r-- | guix/scripts/pack.scm | 21 |
3 files changed, 27 insertions, 8 deletions
diff --git a/guix/build/union.scm b/guix/build/union.scm index 256123c566..d46b750035 100644 --- a/guix/build/union.scm +++ b/guix/build/union.scm @@ -93,7 +93,7 @@ make sure the caller can modify them later." (cond ((null? dirs) ;; The inputs are all files. (format (current-error-port) - "warning: collision encountered: ~{~a ~}~%" + "~%warning: collision encountered:~%~{~a~%~}" files) (let ((file (first files))) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index d4cef6b503..efc6169077 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2018 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org> ;;; Copyright © 2016 David Craven <david@craven.ch> ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> @@ -330,10 +330,12 @@ the expected fields of an <origin> object." (description (assoc-ref meta "description")) (license - (let ((l (assoc-ref meta "license"))) - (or (module-ref (resolve-interface '(guix licenses) #:prefix 'license:) - (spdx-string->license l)) - (license:fsdg-compatible l)))))) + (match (assoc-ref meta "license") + (#f #f) + (l + (or (module-ref (resolve-interface '(guix licenses) #:prefix 'license:) + (spdx-string->license l)) + (license:fsdg-compatible l))))))) (define* (read-lines #:optional (port (current-input-port))) "Read lines from PORT and return them as a list." diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index a22258d5a6..59dd117edb 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2015, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -292,6 +293,9 @@ the image." (option '(#\e "expression") #t #f (lambda (opt name arg result) (alist-cons 'expression arg result))) + (option '(#\m "manifest") #t #f + (lambda (opt name arg result) + (alist-cons 'manifest arg result))) (option '(#\s "system") #t #f (lambda (opt name arg result) (alist-cons 'system arg @@ -345,6 +349,8 @@ Create a bundle of PACKAGE.\n")) (display (G_ " -S, --symlink=SPEC create symlinks to the profile according to SPEC")) (display (G_ " + -m, --manifest=FILE create a pack with the manifest from FILE")) + (display (G_ " --localstatedir include /var/guix in the resulting pack")) (newline) (display (G_ " @@ -375,10 +381,21 @@ Create a bundle of PACKAGE.\n")) (read/eval-package-expression exp)) (x #f))) + (define (manifest-from-args opts) + (let ((packages (filter-map maybe-package-argument opts)) + (manifest-file (assoc-ref opts 'manifest))) + (cond + ((and manifest-file (not (null? packages))) + (leave (G_ "both a manifest and a package list were given~%"))) + (manifest-file + (let ((user-module (make-user-module '((guix profiles) (gnu))))) + (load* manifest-file user-module))) + (else (packages->manifest packages))))) + (with-error-handling (parameterize ((%graft? (assoc-ref opts 'graft?))) (let* ((dry-run? (assoc-ref opts 'dry-run?)) - (packages (filter-map maybe-package-argument opts)) + (manifest (manifest-from-args opts)) (pack-format (assoc-ref opts 'format)) (name (string-append (symbol->string pack-format) "-pack")) @@ -397,7 +414,7 @@ Create a bundle of PACKAGE.\n")) (run-with-store store (mlet* %store-monad ((profile (profile-derivation - (packages->manifest packages) + manifest #:target target)) (drv (build-image name profile #:target |