From 7573d30ff804302eeb68edeca6ae5f3efb48b7bf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 2 Mar 2016 13:43:13 +0100 Subject: 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. --- guix/scripts/archive.scm | 51 +++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 24 deletions(-) (limited to 'guix/scripts/archive.scm') 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~%")))))))))))) -- cgit v1.2.3