summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author宋文武 <iyzsong@member.fsf.org>2019-07-20 12:51:45 +0800
committer宋文武 <iyzsong@member.fsf.org>2019-07-24 20:34:01 +0800
commit3c618b9894d167399b820642d011aed251cf4ba3 (patch)
treee6cdb8208056b7708bf4e041c509f1c40315201a
parent2fa23d8f5c4db6be583f0bb0eeba0368f1513ec7 (diff)
downloadpatches-3c618b9894d167399b820642d011aed251cf4ba3.tar
patches-3c618b9894d167399b820642d011aed251cf4ba3.tar.gz
deploy: Handle the '--system' command line option.
* guix/scripts/deploy.scm (show-help): Add help for '--system'. (%options): Add '-s' and '--system'. (guix-deploy): Parameterize %current-system.
-rw-r--r--guix/scripts/deploy.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index 3acd32eaa7..52bba3f3bf 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -23,6 +23,7 @@
#:use-module (guix scripts build)
#:use-module (guix store)
#:use-module (guix ui)
+ #:use-module (guix utils)
#:use-module (guix grafts)
#:use-module (ice-9 format)
#:use-module (srfi srfi-1)
@@ -41,6 +42,8 @@
(define (show-help)
(display (G_ "Usage: guix deploy [OPTION] FILE...
Perform the deployment specified by FILE.\n"))
+ (display (G_ "
+ -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\""))
(show-build-options-help)
(newline)
(display (G_ "
@@ -55,10 +58,14 @@ Perform the deployment specified by FILE.\n"))
(lambda args
(show-help)
(exit 0)))
+ (option '(#\s "system") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'system arg
+ (alist-delete 'system result eq?))))
%standard-build-options))
(define %default-options
- '((system . ,(%current-system))
+ `((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(graft? . #t)
@@ -81,6 +88,7 @@ Perform the deployment specified by FILE.\n"))
(set-build-options-from-command-line store opts)
(for-each (lambda (machine)
(info (G_ "deploying to ~a...") (machine-display-name machine))
- (parameterize ((%graft? (assq-ref opts 'graft?)))
+ (parameterize ((%current-system (assq-ref opts 'system))
+ (%graft? (assq-ref opts 'graft?)))
(run-with-store store (deploy-machine machine))))
machines))))