[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/13: pack: Use 'with-extensions' when referring to (guix docker).
From: |
Ludovic Courtès |
Subject: |
04/13: pack: Use 'with-extensions' when referring to (guix docker). |
Date: |
Fri, 1 Jun 2018 09:38:32 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 13993c77fec7580f4f10ea07256db9e5f5a7949b
Author: Ludovic Courtès <address@hidden>
Date: Mon May 28 18:22:24 2018 +0200
pack: Use 'with-extensions' when referring to (guix docker).
* guix/docker.scm: Use module (json) the normal way.
* guix/scripts/pack.scm (docker-image)[build]: Wrap in
'with-extensions'.
---
guix/docker.scm | 6 ++----
guix/scripts/pack.scm | 41 +++++++++++++++++++----------------------
2 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/guix/docker.scm b/guix/docker.scm
index a75534c..b869901 100644
--- a/guix/docker.scm
+++ b/guix/docker.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ricardo Wurmus <address@hidden>
-;;; Copyright © 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2017, 2018 Ludovic Courtès <address@hidden>
;;; Copyright © 2018 Chris Marusich <address@hidden>
;;;
;;; This file is part of GNU Guix.
@@ -26,6 +26,7 @@
delete-file-recursively
with-directory-excursion
invoke))
+ #:use-module (json) ;guile-json
#:use-module (srfi srfi-19)
#:use-module (srfi srfi-26)
#:use-module ((texinfo string-utils)
@@ -34,9 +35,6 @@
#:use-module (ice-9 match)
#:export (build-docker-image))
-;; Load Guile-JSON at run time to simplify the job of 'imported-modules' & co.
-(module-use! (current-module) (resolve-interface '(json)))
-
;; Generate a 256-bit identifier in hexadecimal encoding for the Docker image.
(define docker-id
(compose bytevector->base16-string sha256 string->utf8))
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 35b8a7e..76729d8 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -340,28 +340,25 @@ the image."
guile-json))
(define build
- (with-imported-modules `(,@(source-module-closure '((guix docker))
- #:select? not-config?)
- (guix build store-copy)
- ((guix config) => ,config))
- #~(begin
- ;; Guile-JSON is required by (guix docker).
- (add-to-load-path
- (string-append #+json "/share/guile/site/"
- (effective-version)))
-
- (use-modules (guix docker) (srfi srfi-19) (guix build store-copy))
-
- (setenv "PATH" (string-append #$archiver "/bin"))
-
- (build-docker-image #$output
- (call-with-input-file "profile"
- read-reference-graph)
- #$profile
- #:system (or #$target (utsname:machine (uname)))
- #:symlinks '#$symlinks
- #:compressor '#$(compressor-command compressor)
- #:creation-time (make-time time-utc 0 1)))))
+ ;; Guile-JSON is required by (guix docker).
+ (with-extensions (list json)
+ (with-imported-modules `(,@(source-module-closure '((guix docker))
+ #:select? not-config?)
+ (guix build store-copy)
+ ((guix config) => ,config))
+ #~(begin
+ (use-modules (guix docker) (srfi srfi-19) (guix build store-copy))
+
+ (setenv "PATH" (string-append #$archiver "/bin"))
+
+ (build-docker-image #$output
+ (call-with-input-file "profile"
+ read-reference-graph)
+ #$profile
+ #:system (or #$target (utsname:machine
(uname)))
+ #:symlinks '#$symlinks
+ #:compressor '#$(compressor-command compressor)
+ #:creation-time (make-time time-utc 0 1))))))
(gexp->derivation (string-append name ".tar"
(compressor-extension compressor))
- 01/13: tests: Fix arguments in pack test., (continued)
- 01/13: tests: Fix arguments in pack test., Ludovic Courtès, 2018/06/01
- 06/13: bootloader: grub: Simplify 'svg->png'., Ludovic Courtès, 2018/06/01
- 12/13: database: 'register-path' resets timestamps., Ludovic Courtès, 2018/06/01
- 05/13: tests: ssh: Use 'with-extensions'., Ludovic Courtès, 2018/06/01
- 13/13: Add (guix store deduplication)., Ludovic Courtès, 2018/06/01
- 07/13: bootloader: grub: Use 'with-extensions'., Ludovic Courtès, 2018/06/01
- 10/13: build: Check for Guile-SQLite3., Ludovic Courtès, 2018/06/01
- 08/13: profiles: Use 'with-extensions'., Ludovic Courtès, 2018/06/01
- 03/13: gexp: Add 'with-extensions'., Ludovic Courtès, 2018/06/01
- 09/13: vm: Use 'with-extensions'., Ludovic Courtès, 2018/06/01
- 04/13: pack: Use 'with-extensions' when referring to (guix docker).,
Ludovic Courtès <=
- 11/13: Add (gnu store database)., Ludovic Courtès, 2018/06/01