summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/container.scm3
-rw-r--r--guix/scripts/import.scm3
-rw-r--r--guix/scripts/pack.scm1
-rw-r--r--guix/scripts/size.scm11
-rwxr-xr-xguix/scripts/substitute.scm3
-rw-r--r--guix/scripts/system.scm14
-rw-r--r--guix/scripts/weather.scm3
7 files changed, 22 insertions, 16 deletions
diff --git a/guix/scripts/container.scm b/guix/scripts/container.scm
index 10aed2be75..8041d64b6b 100644
--- a/guix/scripts/container.scm
+++ b/guix/scripts/container.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
+;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -54,7 +55,7 @@ Build and manipulate Linux containers.\n"))
((or ("-h") ("--help"))
(show-help)
(exit 0))
- (("--version")
+ ((or ("-V") ("--version"))
(show-version-and-exit "guix container"))
((action args ...)
(if (member action %actions)
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index 67bc7a7553..f8cb85700d 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 David Thompson <davet@gnu.org>
+;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -104,7 +105,7 @@ Run IMPORTER with ARGS.\n"))
((or ("-h") ("--help"))
(show-help)
(exit 0))
- (("--version")
+ ((or ("-V") ("--version"))
(show-version-and-exit "guix import"))
((importer args ...)
(if (member importer importers)
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 7f087a3a3c..6d5d745bc8 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -722,6 +722,7 @@ Create a bundle of PACKAGE.\n"))
(if (assoc-ref opts 'bootstrap?)
%bootstrap-guile
(canonical-package guile-2.2))
+ (assoc-ref opts 'system)
#:graft? (assoc-ref opts 'graft?))))
(let* ((dry-run? (assoc-ref opts 'dry-run?))
(relocatable? (assoc-ref opts 'relocatable?))
diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm
index b7b53e43fb..344be40883 100644
--- a/guix/scripts/size.scm
+++ b/guix/scripts/size.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -53,15 +53,6 @@
(define substitutable-path-info*
(store-lift substitutable-path-info))
-(define (query-path-info* item)
- "Monadic version of 'query-path-info' that returns #f when ITEM is not in
-the store."
- (lambda (store)
- (guard (c ((nix-protocol-error? c)
- ;; ITEM is not in the store; return #f.
- (values #f store)))
- (values (query-path-info store item) store))))
-
(define (file-size item)
"Return the size in bytes of ITEM, resorting to information from substitutes
if ITEM is not in the store."
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index d0beacc8ea..7634bb37f6 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
+;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1108,7 +1109,7 @@ default value."
(process-substitution store-path destination
#:cache-urls (substitute-urls)
#:acl (current-acl))))
- (("--version")
+ ((or ("-V") ("--version"))
(show-version-and-exit "guix substitute"))
(("--help")
(show-help))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 14aedceac1..69bd05b516 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -126,7 +126,11 @@ REFERENCES as its set of references."
;; Remove DEST if it exists to make sure that (1) we do not fail badly
;; while trying to overwrite it (see <http://bugs.gnu.org/20722>), and
;; (2) we end up with the right contents.
- (when (file-exists? dest)
+ (when (false-if-exception (lstat dest))
+ (for-each make-file-writable
+ (find-files dest (lambda (file stat)
+ (eq? 'directory (stat:type stat)))
+ #:directories? #t))
(delete-file-recursively dest))
(copy-recursively item dest
@@ -148,12 +152,18 @@ REFERENCES as its set of references."
"Copy ITEM and all its dependencies to the store under root directory
TARGET, and register them."
(mlet* %store-monad ((to-copy (topologically-sorted* (list item)))
- (refs (mapm %store-monad references* to-copy)))
+ (refs (mapm %store-monad references* to-copy))
+ (info (mapm %store-monad query-path-info*
+ (delete-duplicates
+ (append to-copy (concatenate refs)))))
+ (size -> (reduce + 0 (map path-info-nar-size info))))
(define progress-bar
(progress-reporter/bar (length to-copy)
(format #f (G_ "copying to '~a'...")
target)))
+ (check-available-space size target)
+
(call-with-progress-reporter progress-bar
(lambda (report)
(let ((void (%make-void-port "w")))
diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index d7c2fbea10..98b7338fb9 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -269,7 +270,7 @@ Report the availability of substitutes.\n"))
(exit 0)))
(option '(#\V "version") #f #f
(lambda args
- (show-version-and-exit "guix challenge")))
+ (show-version-and-exit "guix weather")))
(option '("substitute-urls") #t #f
(lambda (opt name arg result . rest)