summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/import/crate.scm2
-rw-r--r--guix/scripts/pack.scm63
-rw-r--r--guix/scripts/package.scm7
-rwxr-xr-xguix/scripts/substitute.scm7
-rw-r--r--guix/scripts/system.scm14
5 files changed, 45 insertions, 48 deletions
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 92034dab3c..d834518c18 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -100,7 +100,7 @@ Import and convert the crate.io package for PACKAGE-NAME.\n"))
`(define-public ,(string->symbol name)
,pkg))
(_ #f))
- (crate-recursive-import name))
+ (crate-recursive-import name version))
(let ((sexp (crate->guix-package name version)))
(unless sexp
(leave (G_ "failed to download meta-data for package '~a'~%")
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index bbacc93bc0..b84e37cbf2 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -319,7 +319,7 @@ to the search paths of PROFILE."
entry-point
localstatedir?
(symlinks '())
- (archiver squashfs-tools-next))
+ (archiver squashfs-tools))
"Return a squashfs image containing a store initialized with the closure of
PROFILE, a derivation. The image contains a subset of /gnu/store, empty mount
points for virtual file systems (like procfs), and optional symlinks.
@@ -753,11 +753,6 @@ last resort for relocation."
(manifest-entry-output entry)
args))))
-(define (map-manifest-entries proc manifest)
- "Apply PROC to all the entries of MANIFEST and return a new manifest."
- (make-manifest
- (map proc (manifest-entries manifest))))
-
;;;
;;; Command-line options.
@@ -979,36 +974,32 @@ Create a bundle of PACKAGE.\n"))
(('manifest . file) file)
(_ #f))
opts)))
- (define properties
+ (define with-provenance
(if (assoc-ref opts 'save-provenance?)
- (lambda (package)
- (match (package-provenance package)
- (#f
- (warning (G_ "could not determine provenance of package ~a~%")
- (package-full-name package))
- '())
- (sexp
- `((provenance . ,sexp)))))
- (const '())))
-
- (cond
- ((and (not (null? manifests)) (not (null? packages)))
- (leave (G_ "both a manifest and a package list were given~%")))
- ((not (null? manifests))
- (concatenate-manifests
- (map (lambda (file)
- (let ((user-module (make-user-module
- '((guix profiles) (gnu)))))
- (load* file user-module)))
- manifests)))
- (else
- (manifest
- (map (match-lambda
- ((package output)
- (package->manifest-entry package output
- #:properties
- (properties package))))
- packages))))))
+ (lambda (manifest)
+ (map-manifest-entries
+ (lambda (entry)
+ (let ((entry (manifest-entry-with-provenance entry)))
+ (unless (assq 'provenance (manifest-entry-properties entry))
+ (warning (G_ "could not determine provenance of package ~a~%")
+ (manifest-entry-name entry)))
+ entry))
+ manifest))
+ identity))
+
+ (with-provenance
+ (cond
+ ((and (not (null? manifests)) (not (null? packages)))
+ (leave (G_ "both a manifest and a package list were given~%")))
+ ((not (null? manifests))
+ (concatenate-manifests
+ (map (lambda (file)
+ (let ((user-module (make-user-module
+ '((guix profiles) (gnu)))))
+ (load* file user-module)))
+ manifests)))
+ (else
+ (packages->manifest packages))))))
(with-error-handling
(with-store store
@@ -1045,7 +1036,7 @@ Create a bundle of PACKAGE.\n"))
bootstrap-xz
(assoc-ref opts 'compressor)))
(archiver (if (equal? pack-format 'squashfs)
- squashfs-tools-next
+ squashfs-tools
(if bootstrap?
%bootstrap-coreutils&co
tar)))
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 92c6e34194..ea16435d2d 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -38,7 +38,7 @@
#:use-module (guix config)
#:use-module (guix scripts)
#:use-module (guix scripts build)
- #:autoload (guix describe) (package-provenance)
+ #:use-module (guix describe)
#:autoload (guix store roots) (gc-roots)
#:use-module ((guix build utils)
#:select (directory-exists? mkdir-p))
@@ -883,7 +883,10 @@ processed, #f otherwise."
opts))
(manifest (match files
(() (profile-manifest profile))
- (_ (concatenate-manifests (map load-manifest files)))))
+ (_ (map-manifest-entries
+ manifest-entry-with-provenance
+ (concatenate-manifests
+ (map load-manifest files))))))
(step1 (options->removable opts manifest
(manifest-transaction)))
(step2 (options->installable opts manifest step1))
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 7eca2c6874..3bf9b8735f 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;;
@@ -20,7 +20,7 @@
(define-module (guix scripts substitute)
#:use-module (guix ui)
- #:use-module ((guix store) #:hide (close-connection))
+ #:use-module (guix store)
#:use-module (guix utils)
#:use-module (guix combinators)
#:use-module (guix config)
@@ -37,7 +37,6 @@
#:select (uri-abbreviation nar-uri-abbreviation
(open-connection-for-uri
. guix:open-connection-for-uri)
- close-connection
store-path-abbreviation byte-count->string))
#:use-module (guix progress)
#:use-module ((guix build syscalls)
@@ -556,7 +555,7 @@ initial connection on which HTTP requests are sent."
;; Note that even upon "Connection: close", we can read from BODY.
(match (assq 'connection (response-headers resp))
(('connection 'close)
- (close-connection p)
+ (close-port p)
(connect #f ;try again
(append tail (drop requests processed))
result))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 3e9570753d..e69a3b6c97 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -1189,6 +1189,11 @@ resulting from command-line parsing."
(define (process-command command args opts)
"Process COMMAND, one of the 'guix system' sub-commands. ARGS is its
argument list and OPTS is the option alist."
+ (define-syntax-rule (with-store* store exp ...)
+ (with-store store
+ (set-build-options-from-command-line store opts)
+ exp ...))
+
(case command
;; The following commands do not need to use the store, and they do not need
;; an operating system configuration file.
@@ -1213,22 +1218,20 @@ argument list and OPTS is the option alist."
(() #f)
((pattern) pattern)
(x (leave (G_ "wrong number of arguments~%"))))))
- (with-store store
+ (with-store* store
(delete-matching-generations store %system-profile pattern)
(reinstall-bootloader store (generation-number %system-profile)))))
((switch-generation)
(let ((pattern (match args
((pattern) pattern)
(x (leave (G_ "wrong number of arguments~%"))))))
- (with-store store
- (set-build-options-from-command-line store opts)
+ (with-store* store
(switch-to-system-generation store pattern))))
((roll-back)
(let ((pattern (match args
(() "")
(x (leave (G_ "wrong number of arguments~%"))))))
- (with-store store
- (set-build-options-from-command-line store opts)
+ (with-store* store
(roll-back-system store))))
;; The following commands need to use the store, and they also
;; need an operating system configuration file.
@@ -1297,6 +1300,7 @@ argument list and OPTS is the option alist."
;;; Local Variables:
;;; eval: (put 'call-with-service-upgrade-info 'scheme-indent-function 1)
+;;; eval: (put 'with-store* 'scheme-indent-function 1)
;;; End:
;;; system.scm ends here