From 121191f23ae89415dfbbd3052c7342188cded135 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 2 Mar 2020 20:13:39 +0000 Subject: substitute: Use the same port for multiple request batches. In http-multiple-get. * guix/scripts/substitute.scm (http-multiple-get): Switch port to p in one occurrence. --- guix/scripts/substitute.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix/scripts') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 95b47a7816..2cb240c2a0 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -538,7 +538,7 @@ initial connection on which HTTP requests are sent." (() (reverse result)) (remainder - (connect port remainder result)))) + (connect p remainder result)))) ((head tail ...) (let* ((resp (read-response p)) (body (response-body-port resp)) -- cgit v1.2.3 From d5abb3049ee4e97865f691eba4c59f5b51de3271 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 2 Mar 2020 20:17:18 +0000 Subject: substitute: Make http-multiple-get batch size configurable. * guix/scripts/substitute.scm (http-multiple-get): Add batch-size parameter. --- guix/scripts/substitute.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 2cb240c2a0..0777aa3d3e 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -494,7 +494,8 @@ MAX-LENGTH first elements." (loop (+ 1 len) tail (cons head result))))))) (define* (http-multiple-get base-uri proc seed requests - #:key port (verify-certificate? #t)) + #:key port (verify-certificate? #t) + (batch-size 1000)) "Send all of REQUESTS to the server at BASE-URI. Call PROC for each response, passing it the request object, the response, a port from which to read the response body, and the previous result, starting with SEED, à la @@ -504,7 +505,7 @@ initial connection on which HTTP requests are sent." (requests requests) (result seed)) (define batch - (at-most 1000 requests)) + (at-most batch-size requests)) ;; (format (current-error-port) "connecting (~a requests left)..." ;; (length requests)) -- cgit v1.2.3 From 928dc1bb1c1e96e6dfbe03dac2185ecf41a7b4f5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 2 Mar 2020 20:20:40 +0000 Subject: substitute: Close port at the end of http-multiple-get. * guix/scripts/substitute.scm (http-multiple-get): Add close-port call. --- guix/scripts/substitute.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'guix/scripts') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 0777aa3d3e..ba2b2d2d4e 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -537,6 +537,7 @@ initial connection on which HTTP requests are sent." (() (match (drop requests processed) (() + (close-port p) (reverse result)) (remainder (connect p remainder result)))) -- cgit v1.2.3 From 45c84c8f6f979c84d08b205ed3fb3d6769c4ae3f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 22 Apr 2020 16:11:25 +0200 Subject: pack: Use a declarative profile. * guix/scripts/pack.scm (guix-pack): Use a declarative profile instead of 'profile-derivation'. --- guix/scripts/pack.scm | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 6d63fb4b90..f3d1b41c6f 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -1071,7 +1071,21 @@ Create a bundle of PACKAGE.\n")) (localstatedir? (assoc-ref opts 'localstatedir?)) (entry-point (assoc-ref opts 'entry-point)) (profile-name (assoc-ref opts 'profile-name)) - (gc-root (assoc-ref opts 'gc-root))) + (gc-root (assoc-ref opts 'gc-root)) + (profile (profile + (content manifest) + + ;; Always produce relative symlinks for + ;; Singularity (see + ;; ). + (relative-symlinks? + (or relocatable? + (eq? 'squashfs pack-format))) + + (hooks (if bootstrap? + '() + %default-profile-hooks)) + (locales? (not bootstrap?))))) (define (lookup-package package) (manifest-lookup manifest (manifest-pattern (name package)))) @@ -1085,22 +1099,7 @@ Create a bundle of PACKAGE.\n")) to your package list."))) (run-with-store store - (mlet* %store-monad ((profile (profile-derivation - manifest - - ;; Always produce relative - ;; symlinks for Singularity (see - ;; ). - #:relative-symlinks? - (or relocatable? - (eq? 'squashfs pack-format)) - - #:hooks (if bootstrap? - '() - %default-profile-hooks) - #:locales? (not bootstrap?) - #:target target)) - (drv (build-image name profile + (mlet* %store-monad ((drv (build-image name profile #:target target #:compressor -- cgit v1.2.3 From 47f82b310e320ed6c0282c89748485d1f9212d2c Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Wed, 22 Apr 2020 20:55:40 -0400 Subject: guix: edit: Make nano the default editor. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/edit.scm: Make nano the default editor. Nano is sensible default, as it is installed by base system. For development, user can set custom value for $EDITOR. Signed-off-by: Ludovic Courtès --- guix/scripts/edit.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm index a6fd1d2751..43f3011869 100644 --- a/guix/scripts/edit.scm +++ b/guix/scripts/edit.scm @@ -56,10 +56,9 @@ Start $VISUAL or $EDITOR to edit the definitions of PACKAGE...\n")) (show-bug-report-information)) (define %editor - ;; XXX: It would be better to default to something more likely to be - ;; pre-installed on an average GNU system. Since Nano is not suited for - ;; editing Scheme, Emacs is used instead. - (make-parameter (or (getenv "VISUAL") (getenv "EDITOR") "emacs"))) + ;; Nano is sensible default, as it is installed by base system. + ;; For development, user can set custom value for $EDITOR. + (make-parameter (or (getenv "VISUAL") (getenv "EDITOR") "nano"))) (define (search-path* path file) "Like 'search-path' but exit if FILE is not found." -- cgit v1.2.3