summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-04-12 15:43:55 +0200
committerLudovic Courtès <ludo@gnu.org>2013-04-12 17:31:05 +0200
commit3b8246057629c5fbdcb297da12f88fae69ee1a9a (patch)
treeb3686e6fca5122021bb1d6a9d699c35a216d1e58 /guix/scripts
parentfe0cff14f6c5facee4192529f5c7b7a972f185ca (diff)
guix package: Add `--no-substitutes'.
* guix/scripts/package.scm (%default-options): Add `substitutes?'. (show-help, %options): Add and document `--no-substitutes'. (guix-package): Call `set-build-options' to honor `substitutes?'.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/package.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 89708ccc49..ba75cd778c 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -313,7 +313,8 @@ but ~a is available upstream~%")
(define %default-options
;; Alist of default option values.
- `((profile . ,%current-profile)))
+ `((profile . ,%current-profile)
+ (substitutes? . #t)))
(define (show-help)
(display (_ "Usage: guix package [OPTION]... PACKAGES...
@@ -335,6 +336,8 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
(display (_ "
-n, --dry-run show what would be done without actually doing it"))
(display (_ "
+ --no-substitutes build instead of resorting to pre-built substitutes"))
+ (display (_ "
--bootstrap use the bootstrap Guile to build the profile"))
(display (_ "
--verbose produce verbose output"))
@@ -388,6 +391,10 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
(option '(#\n "dry-run") #f #f
(lambda (opt name arg result)
(alist-cons 'dry-run? #t result)))
+ (option '("no-substitutes") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'substitutes? #f
+ (alist-delete 'substitutes? result))))
(option '("bootstrap") #f #f
(lambda (opt name arg result)
(alist-cons 'bootstrap? #t result)))
@@ -750,6 +757,10 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
(or (process-query opts)
(with-error-handling
(parameterize ((%store (open-connection)))
+ (set-build-options (%store)
+ #:use-substitutes?
+ (assoc-ref opts 'substitutes?))
+
(parameterize ((%guile-for-build
(package-derivation (%store)
(if (assoc-ref opts 'bootstrap?)