summaryrefslogtreecommitdiff
path: root/guix/scripts/archive.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-03-02 13:43:13 +0100
committerLudovic Courtès <ludo@gnu.org>2016-03-02 14:47:07 +0100
commit7573d30ff804302eeb68edeca6ae5f3efb48b7bf (patch)
treed31a92b4672e04f0b598ddcf1184d66fc9a372b7 /guix/scripts/archive.scm
parent1cbdf82d3ba5b257e44144788244139ae15689c8 (diff)
downloadguix-patches-7573d30ff804302eeb68edeca6ae5f3efb48b7bf.tar
guix-patches-7573d30ff804302eeb68edeca6ae5f3efb48b7bf.tar.gz
guix build: Move '--no-grafts' to the common build options.
* guix/scripts/build.scm (%options): Move --no-grafts to... (%standard-build-options): ... here. (show-help, show-build-options-help): Adjust accordingly. * guix/scripts/archive.scm (%default-options): Add 'graft?'. (guix-archive): Parametrize '%graft?'. * guix/scripts/environment.scm (%default-options): Add 'graft?'. (guix-environment): Parametrize '%graft?'. * guix/scripts/package.scm (%default-options): Add 'graft?'. (guix-package): Parametrize '%graft?'. * guix/scripts/system.scm (%default-options): Add 'graft?'. (guix-system): Parametrize 'graft?'. * doc/guix.texi (Additional Build Options): Move --no-grafts to... (Common Build Options): ... here.
Diffstat (limited to 'guix/scripts/archive.scm')
-rw-r--r--guix/scripts/archive.scm51
1 files changed, 27 insertions, 24 deletions
diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm
index 16ca96bdf5..3fb210ee91 100644
--- a/guix/scripts/archive.scm
+++ b/guix/scripts/archive.scm
@@ -22,6 +22,7 @@
#:use-module ((guix build utils) #:select (mkdir-p))
#:use-module ((guix serialization) #:select (restore-file))
#:use-module (guix store)
+ #:use-module (guix grafts)
#:use-module (guix packages)
#:use-module (guix derivations)
#:use-module (guix monads)
@@ -50,6 +51,7 @@
;; Alist of default option values.
`((system . ,(%current-system))
(substitutes? . #t)
+ (graft? . #t)
(max-silent-time . 3600)
(verbosity . 0)))
@@ -318,27 +320,28 @@ the input port."
;; user to 'read-derivation' are absolute when it returns.
(with-fluids ((%file-port-name-canonicalization 'absolute))
(let ((opts (parse-command-line args %options (list %default-options))))
- (cond ((assoc-ref opts 'generate-key)
- =>
- generate-key-pair)
- ((assoc-ref opts 'authorize)
- (authorize-key))
- (else
- (with-store store
- (cond ((assoc-ref opts 'export)
- (export-from-store store opts))
- ((assoc-ref opts 'import)
- (import-paths store (current-input-port)))
- ((assoc-ref opts 'missing)
- (let* ((files (lines (current-input-port)))
- (missing (remove (cut valid-path? store <>)
- files)))
- (format #t "~{~a~%~}" missing)))
- ((assoc-ref opts 'extract)
- =>
- (lambda (target)
- (restore-file (current-input-port) target)))
- (else
- (leave
- (_ "either '--export' or '--import' \
-must be specified~%")))))))))))
+ (parameterize ((%graft? (assoc-ref opts 'graft?)))
+ (cond ((assoc-ref opts 'generate-key)
+ =>
+ generate-key-pair)
+ ((assoc-ref opts 'authorize)
+ (authorize-key))
+ (else
+ (with-store store
+ (cond ((assoc-ref opts 'export)
+ (export-from-store store opts))
+ ((assoc-ref opts 'import)
+ (import-paths store (current-input-port)))
+ ((assoc-ref opts 'missing)
+ (let* ((files (lines (current-input-port)))
+ (missing (remove (cut valid-path? store <>)
+ files)))
+ (format #t "~{~a~%~}" missing)))
+ ((assoc-ref opts 'extract)
+ =>
+ (lambda (target)
+ (restore-file (current-input-port) target)))
+ (else
+ (leave
+ (_ "either '--export' or '--import' \
+must be specified~%"))))))))))))