From 44c6a87f53690dd47a8ef1f139b863ba696104a1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 25 Oct 2017 20:35:43 -0700 Subject: guix package: '--list-available' does not show superseded packages. * guix/scripts/package.scm (process-query) <'list-available>: Filter out P if it matches 'package-superseded'. --- guix/scripts/package.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 0e365018a9..f972ca2ef7 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -738,7 +738,8 @@ processed, #f otherwise." (available (fold-packages (lambda (p r) (let ((n (package-name p))) - (if (supported-package? p) + (if (and (supported-package? p) + (not (package-superseded p))) (if regexp (if (regexp-exec regexp n) (cons p r) -- cgit v1.2.3 From d213cc8c7f085428e3c64243b0d163423e4bb5f6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 25 Oct 2017 20:57:06 -0700 Subject: substitute: Don't send more than 1000 requests in a row. Fixes . Reported by Jan Nieuwenhuizen . * guix/scripts/substitute.scm (at-most): New procedure. (http-multiple-get): Use it to send at most 1000 requests at once. --- guix/scripts/substitute.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 1fbeed71e8..2fd2bf8104 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -533,6 +533,20 @@ indicates that PATH is unavailable at CACHE-URL." (headers '((User-Agent . "GNU Guile")))) (build-request (string->uri url) #:method 'GET #:headers headers))) +(define (at-most max-length lst) + "If LST is shorter than MAX-LENGTH, return it; otherwise return its +MAX-LENGTH first elements." + (let loop ((len 0) + (lst lst) + (result '())) + (match lst + (() + (reverse result)) + ((head . tail) + (if (>= len max-length) + (reverse result) + (loop (+ 1 len) tail (cons head result))))))) + (define* (http-multiple-get base-uri proc seed requests #:key port (verify-certificate? #t)) "Send all of REQUESTS to the server at BASE-URI. Call PROC for each @@ -553,7 +567,7 @@ initial connection on which HTTP requests are sent." (when (file-port? p) (setvbuf p _IOFBF (expt 2 16))) - ;; Send all of REQUESTS in a row. + ;; Send REQUESTS, up to a certain number, in a row. ;; XXX: Do our own caching to work around inefficiencies when ;; communicating over TLS: . (let-values (((buffer get) (open-bytevector-output-port))) @@ -562,7 +576,8 @@ initial connection on which HTTP requests are sent." 'http-proxy-port?) (set-http-proxy-port?! buffer (http-proxy-port? p))) - (for-each (cut write-request <> buffer) requests) + (for-each (cut write-request <> buffer) + (at-most 1000 requests)) (put-bytevector p (get)) (force-output p)) -- cgit v1.2.3 From bf7dfb1f0722f48b137f85ade6b075ad342ecb38 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 25 Oct 2017 21:00:17 -0700 Subject: challenge: Display an overall summary. * guix/scripts/challenge.scm (summarize-report-list): New procedure. (guix-challenge): Use it. * doc/guix.texi (Invoking guix challenge): Adjust command output in example. --- doc/guix.texi | 7 +++++++ guix/scripts/challenge.scm | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index d7fabe9599..94cba0e1da 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7276,6 +7276,13 @@ updating list of substitutes from 'https://guix.example.org'... 100.0% local hash: 0k4v3m9z1zp8xzzizb7d8kjj72f9172xv078sq4wl73vnq9ig3ax https://hydra.gnu.org/nar/@dots{}-pius-2.1.1: 0k4v3m9z1zp8xzzizb7d8kjj72f9172xv078sq4wl73vnq9ig3ax https://guix.example.org/nar/@dots{}-pius-2.1.1: 1cy25x1a4fzq5rk0pmvc8xhwyffnqz95h2bpvqsz2mpvlbccy0gs + +@dots{} + +6,406 store items were analyzed: + - 4,749 (74.1%) were identical + - 525 (8.2%) differed + - 1,132 (17.7%) were inconclusive @end smallexample @noindent diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm index 681394f9cf..e82d5351d8 100644 --- a/guix/scripts/challenge.scm +++ b/guix/scripts/challenge.scm @@ -210,6 +210,20 @@ inconclusive reports." (report (G_ "~a contents match:~%") item) (report-hashes item local narinfos))))) +(define (summarize-report-list reports) + "Display the overall summary of REPORTS." + (let ((total (length reports)) + (inconclusive (count comparison-report-inconclusive? reports)) + (matches (count comparison-report-match? reports)) + (discrepancies (count comparison-report-mismatch? reports))) + (report (G_ "~h store items were analyzed:~%") total) + (report (G_ " - ~h (~,1f%) were identical~%") + matches (* 100. (/ matches total))) + (report (G_ " - ~h (~,1f%) differed~%") + discrepancies (* 100. (/ discrepancies total))) + (report (G_ " - ~h (~,1f%) were inconclusive~%") + inconclusive (* 100. (/ inconclusive total))))) + ;;; ;;; Command-line options. @@ -292,6 +306,8 @@ Challenge the substitutes for PACKAGE... provided by one or more servers.\n")) (reports (compare-contents items urls))) (for-each (cut summarize-report <> #:verbose? verbose?) reports) + (report "\n") + (summarize-report-list reports) (exit (cond ((any comparison-report-mismatch? reports) 2) ((every comparison-report-match? reports) 0) -- cgit v1.2.3 From 552ee77250409de0bde2b75f60eb5ddd0f881045 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 25 Oct 2017 22:43:36 -0400 Subject: build-system/go: Fix installation path of executable files. * guix/build/go-build-system.scm (setup-environment): Set GOBIN correctly. --- guix/build/go-build-system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 72af6ce7b6..d175f3b76a 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -171,7 +171,7 @@ respectively." (setenv "GOPATH" (string-append (getcwd) ":" (getenv "GOPATH"))) (setenv "GOPATH" (getcwd))) ;; Where to install compiled executable files ('commands' in Go parlance'). - (setenv "GOBIN" out) + (setenv "GOBIN" (string-append out "/bin")) #t)) (define* (build #:key import-path #:allow-other-keys) -- cgit v1.2.3 From efff3dd4c984f0c2e6f8cb63cf109a6c7b89dea0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 13:11:26 -0700 Subject: scripts: Use 'args-fold*' for command that do not honor build flags. Fixes . Reported by Eric Bavier. * guix/scripts/challenge.scm (guix-challenge): Use 'args-fold*' instead of 'parse-command-line'. * guix/scripts/size.scm (guix-size): Likewise. * guix/scripts/weather.scm (guix-weather): Likewise. --- guix/scripts/challenge.scm | 7 ++++++- guix/scripts/size.scm | 7 ++++++- guix/scripts/weather.scm | 8 ++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm index e82d5351d8..5c59fbe21c 100644 --- a/guix/scripts/challenge.scm +++ b/guix/scripts/challenge.scm @@ -278,7 +278,12 @@ Challenge the substitutes for PACKAGE... provided by one or more servers.\n")) (define (guix-challenge . args) (with-error-handling - (let* ((opts (parse-command-line args %options (list %default-options))) + (let* ((opts (args-fold* args %options + (lambda (opt name arg . rest) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) (files (filter-map (match-lambda (('argument . file) file) (_ #f)) diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index eade184e67..dee3604174 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -291,7 +291,12 @@ Report the size of PACKAGE and its dependencies.\n")) (define (guix-size . args) (with-error-handling - (let* ((opts (parse-command-line args %options (list %default-options))) + (let* ((opts (args-fold* args %options + (lambda (opt name arg . rest) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) (files (filter-map (match-lambda (('argument . file) file) (_ #f)) diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 4c4dfac8f6..7f42f9475d 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -204,8 +204,12 @@ Report the availability of substitutes.\n")) (define (guix-weather . args) (with-error-handling - (let* ((opts (parse-command-line args %options - (list %default-options))) + (let* ((opts (args-fold* args %options + (lambda (opt name arg . rest) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) (urls (assoc-ref opts 'substitute-urls)) (systems (match (filter-map (match-lambda (('system . system) system) -- cgit v1.2.3 From a1ff7e1d8dfb86ae1817d4e0db4ddeebd2083e83 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 13:28:00 -0700 Subject: scripts: Factorize option parsing sans 'GUIX_BUILD_OPTIONS'. * guix/scripts.scm (parse-command-line): Add #:build-options? parameter and honor it. * guix/scripts/challenge.scm (guix-challenge): Use 'parse-command-line' with #:build-options? #f instead of 'args-fold*'. * guix/scripts/gc.scm (guix-gc): Likewise. * guix/scripts/graph.scm (guix-graph): Likewise. * guix/scripts/hash.scm (guix-hash): Likewise. * guix/scripts/lint.scm (guix-lint): Likewise. * guix/scripts/refresh.scm (guix-refresh): Likewise. * guix/scripts/size.scm (guix-size): Likewise. * guix/scripts/weather.scm (guix-weather): Likewise. --- guix/scripts.scm | 14 +++++++++----- guix/scripts/challenge.scm | 8 ++------ guix/scripts/gc.scm | 8 ++------ guix/scripts/graph.scm | 9 +++------ guix/scripts/hash.scm | 9 ++------- guix/scripts/lint.scm | 8 ++------ guix/scripts/refresh.scm | 8 ++------ guix/scripts/size.scm | 8 ++------ guix/scripts/weather.scm | 9 +++------ 9 files changed, 27 insertions(+), 54 deletions(-) (limited to 'guix') diff --git a/guix/scripts.scm b/guix/scripts.scm index 9ff7f25548..4a7ae7baa3 100644 --- a/guix/scripts.scm +++ b/guix/scripts.scm @@ -67,11 +67,13 @@ reporting." (define* (parse-command-line args options seeds #:key + (build-options? #t) (argument-handler %default-argument-handler)) - "Parse the command-line arguments ARGS as well as arguments passed via the -'GUIX_BUILD_OPTIONS' environment variable according to OPTIONS (a list of -SRFI-37 options) and return the result, seeded by SEEDS. -Command-line options take precedence those passed via 'GUIX_BUILD_OPTIONS'. + "Parse the command-line arguments ARGS according to OPTIONS (a list of +SRFI-37 options) and return the result, seeded by SEEDS. When BUILD-OPTIONS? +is true, also pass arguments passed via the 'GUIX_BUILD_OPTIONS' environment +variable. Command-line options take precedence those passed via +'GUIX_BUILD_OPTIONS'. ARGUMENT-HANDLER is called for non-option arguments, like the 'operand-proc' parameter of 'args-fold'." @@ -85,7 +87,9 @@ parameter of 'args-fold'." (call-with-values (lambda () - (parse-options-from (environment-build-options) seeds)) + (if build-options? + (parse-options-from (environment-build-options) seeds) + (apply values seeds))) (lambda seeds ;; ARGS take precedence over what the environment variable specifies. (parse-options-from args seeds)))) diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm index 5c59fbe21c..f0693ed8df 100644 --- a/guix/scripts/challenge.scm +++ b/guix/scripts/challenge.scm @@ -278,12 +278,8 @@ Challenge the substitutes for PACKAGE... provided by one or more servers.\n")) (define (guix-challenge . args) (with-error-handling - (let* ((opts (args-fold* args %options - (lambda (opt name arg . rest) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (let* ((opts (parse-command-line args %options (list %default-options) + #:build-options? #f)) (files (filter-map (match-lambda (('argument . file) file) (_ #f)) diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index 0a9719d259..378a47d113 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -159,12 +159,8 @@ Invoke the garbage collector.\n")) (define (guix-gc . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options - (lambda (opt name arg result) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (parse-command-line args %options (list %default-options) + #:build-options? #f)) (define (symlink-target file) (let ((s (false-if-exception (lstat file)))) diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index d5be442884..6b809d3ade 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -447,12 +447,9 @@ Emit a Graphviz (dot) representation of the dependencies of PACKAGE...\n")) (define (guix-graph . args) (with-error-handling - (let* ((opts (args-fold* args %options - (lambda (opt name arg . rest) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (let* ((opts (parse-command-line args %options + (list %default-options) + #:build-options? #f)) (backend (assoc-ref opts 'backend)) (type (assoc-ref opts 'node-type)) (items (filter-map (match-lambda diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index 1fa6bb8d1f..cae5d6bcdf 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -104,13 +104,8 @@ and 'hexadecimal' can be used as well).\n")) (define (guix-hash . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options - (lambda (opt name arg result) - (leave (G_ "unrecognized option: ~a~%") - name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (parse-command-line args %options (list %default-options) + #:build-options? #f)) (define (vcs-file? file stat) (case (stat:type stat) diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index a26f92f49c..0338d4cb13 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -1123,12 +1123,8 @@ run the checkers on all packages.\n")) (define (guix-lint . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options - (lambda (opt name arg result) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (parse-command-line args %options (list %default-options) + #:build-options? #f)) (let* ((opts (parse-options)) (args (filter-map (match-lambda diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index d638d744af..852b44b38d 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -338,12 +338,8 @@ dependent packages are rebuilt: ~{~a~^ ~}~%" (define (guix-refresh . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options - (lambda (opt name arg result) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (parse-command-line args %options (list %default-options) + #:build-options? #f)) (define (options->updaters opts) ;; Return the list of updaters to use. diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index dee3604174..b7b53e43fb 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -291,12 +291,8 @@ Report the size of PACKAGE and its dependencies.\n")) (define (guix-size . args) (with-error-handling - (let* ((opts (args-fold* args %options - (lambda (opt name arg . rest) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (let* ((opts (parse-command-line args %options (list %default-options) + #:build-options? #f)) (files (filter-map (match-lambda (('argument . file) file) (_ #f)) diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 7f42f9475d..0d4a7fa26b 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -204,12 +204,9 @@ Report the availability of substitutes.\n")) (define (guix-weather . args) (with-error-handling - (let* ((opts (args-fold* args %options - (lambda (opt name arg . rest) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (let* ((opts (parse-command-line args %options + (list %default-options) + #:build-options? #f)) (urls (assoc-ref opts 'substitute-urls)) (systems (match (filter-map (match-lambda (('system . system) system) -- cgit v1.2.3 From 4b879e0acf30e7ac941cff5581107b23c29e1883 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 14:23:40 -0700 Subject: lint: Extract network-related exception handling. * guix/scripts/lint.scm (call-with-networking-fail-safe): New procedure. (with-networking-fail-safe): New macro. (current-vulnerabilities*): Rewrite in terms of 'with-networking-fail-safe'. --- guix/scripts/lint.scm | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'guix') diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 0338d4cb13..ec6446ef47 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -792,35 +792,44 @@ be determined." ((? origin?) (and=> (origin-actual-file-name patch) basename)))) -(define (current-vulnerabilities*) - "Like 'current-vulnerabilities', but return the empty list upon networking -or HTTP errors. This allows network-less operation and makes problems with -the NIST server non-fatal.." +(define (call-with-networking-fail-safe message error-value proc) + "Call PROC catching any network-related errors. Upon a networking error, +display a message including MESSAGE and return ERROR-VALUE." (guard (c ((http-get-error? c) - (warning (G_ "failed to retrieve CVE vulnerabilities \ -from ~s: ~a (~s)~%") + (warning (G_ "~a: HTTP GET error for ~a: ~a (~s)~%") + message (uri->string (http-get-error-uri c)) (http-get-error-code c) (http-get-error-reason c)) - (warning (G_ "assuming no CVE vulnerabilities~%")) - '())) + error-value)) (catch #t - (lambda () - (current-vulnerabilities)) + proc (match-lambda* (('getaddrinfo-error errcode) - (warning (G_ "failed to lookup NIST host: ~a~%") + (warning (G_ "~a: host lookup failure: ~a~%") + message (gai-strerror errcode)) - (warning (G_ "assuming no CVE vulnerabilities~%")) - '()) + error-value) (('tls-certificate-error args ...) - (warning (G_ "TLS certificate error: ~a") + (warning (G_ "~a: TLS certificate error: ~a") + message (tls-certificate-error-string args)) - (warning (G_ "assuming no CVE vulnerabilities~%")) - '()) + error-value) (args (apply throw args)))))) +(define-syntax-rule (with-networking-fail-safe message error-value exp ...) + (call-with-networking-fail-safe message error-value + (lambda () exp ...))) + +(define (current-vulnerabilities*) + "Like 'current-vulnerabilities', but return the empty list upon networking +or HTTP errors. This allows network-less operation and makes problems with +the NIST server non-fatal." + (with-networking-fail-safe (G_ "while retrieving CVE vulnerabilities") + '() + (current-vulnerabilities))) + (define package-vulnerabilities (let ((lookup (delay (vulnerabilities->lookup-proc (current-vulnerabilities*))))) -- cgit v1.2.3 From 6d6d19322124dcd963e801453ed026620634d0b3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 14:27:47 -0700 Subject: lint: 'refresh' gracefully handles lack of networking access. * guix/scripts/lint.scm (check-for-updates): Wrap 'package-latest-release*' call in 'with-networking-fail-safe'. --- guix/scripts/lint.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index ec6446ef47..8840b1acb5 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -869,7 +869,11 @@ the NIST server non-fatal." (define (check-for-updates package) "Check if there is an update available for PACKAGE." - (match (package-latest-release* package (force %updaters)) + (match (with-networking-fail-safe + (format #f (G_ "while retrieving upstream info for '~a'") + (package-name package)) + #f + (package-latest-release* package (force %updaters))) ((? upstream-source? source) (when (version>? (upstream-source-version source) (package-version package)) -- cgit v1.2.3 From 90297811a9d6412fcf57bd6bef08ded39ac895cc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 14:38:45 -0700 Subject: import: github: Gracefully handle multiple-URL origins. * guix/import/github.scm (latest-release)[origin-github-uri]: New procedure. Use it. --- guix/import/github.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/import/github.scm b/guix/import/github.scm index b249b39067..4b7d53c704 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Ben Woodcroft +;;; Copyright © 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +20,7 @@ (define-module (guix import github) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (json) #:use-module (guix utils) @@ -182,7 +184,14 @@ https://github.com/settings/tokens")) (define (latest-release pkg) "Return an for the latest release of PKG." - (let* ((source-uri (origin-uri (package-source pkg))) + (define (origin-github-uri origin) + (match (origin-uri origin) + ((? string? url) + url) ;surely a github.com URL + ((urls ...) + (find (cut string-contains <> "github.com") urls)))) + + (let* ((source-uri (origin-github-uri (package-source pkg))) (name (package-name pkg)) (newest-version (latest-released-version source-uri name))) (if newest-version -- cgit v1.2.3 From 0a2ce1ea0ad2f1269cba3f77a77bb336ba2ef0b3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 14:43:19 -0700 Subject: import: elpa: Do not abort when failing to download the archive. * guix/import/elpa.scm (elpa-fetch-archive): Use 'http-fetch/cached' directly instead of 'call-with-downloaded-file'. This ensures we don't just abort when networking access is lacking, which is required to allow 'guix refresh -c refresh' to proceed. --- guix/import/elpa.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 858eea88e2..45a419217c 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -80,8 +80,11 @@ NAMES (strings)." (cut string-append <> "/archive-contents")))) (if url ;; Use a relatively small TTL for the archive itself. - (parameterize ((%http-cache-ttl (* 6 3600))) - (call-with-downloaded-file url read)) + (let* ((port (http-fetch/cached (string->uri url) + #:ttl (* 6 3600))) + (data (read port))) + (close-port port) + data) (leave (G_ "~A: currently not supported~%") repo)))) (define* (call-with-downloaded-file url proc #:optional (error-thunk #f)) -- cgit v1.2.3 From 34b1f339cd8f709941593ec2ae0b55ed1e13cb6e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 14:53:17 -0700 Subject: graph: Remove mention of Graphviz from the summary line. * guix/scripts/graph.scm (show-help): Remove mention of Graphviz from the summary line. --- guix/scripts/graph.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 6b809d3ade..78f09f181b 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -417,7 +417,7 @@ substitutes." ;; TRANSLATORS: Here 'dot' is the name of a program; it must not be ;; translated. (display (G_ "Usage: guix graph PACKAGE... -Emit a Graphviz (dot) representation of the dependencies of PACKAGE...\n")) +Emit a representation of the dependency graph of PACKAGE...\n")) (display (G_ " -b, --backend=TYPE produce a graph with the given backend TYPE")) (display (G_ " -- cgit v1.2.3 From 23055424f2628470a864106dbc4d4acb003399ee Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sat, 28 Oct 2017 18:13:08 -0500 Subject: import: cpan: Propagate imported dependencies. This is most often the need for perl module dependencies. * guix/import/cpan.scm (cpan-module->sexp): 'inputs -> 'propagated-inputs. * tests/cpan.scm ("cpan->guix-package"): Adjust accordingly. --- guix/import/cpan.scm | 2 +- tests/cpan.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 6261e3e924..15b121e829 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -242,7 +242,7 @@ META." ;; have not yet had a need for cross-compiled perl ;; modules, however, so we leave it out. (convert-inputs '("configure" "build" "test"))) - ,@(maybe-inputs 'inputs + ,@(maybe-inputs 'propagated-inputs (convert-inputs '("runtime"))) (home-page ,(string-append "http://search.cpan.org/dist/" name)) (synopsis ,(assoc-ref meta "abstract")) diff --git a/tests/cpan.scm b/tests/cpan.scm index 8900716cb0..91e2cc6814 100644 --- a/tests/cpan.scm +++ b/tests/cpan.scm @@ -94,7 +94,7 @@ ('base32 (? string? hash))))) ('build-system 'perl-build-system) - ('inputs + ('propagated-inputs ('quasiquote (("perl-test-script" ('unquote 'perl-test-script))))) ('home-page "http://search.cpan.org/dist/Foo-Bar") -- cgit v1.2.3 From e4bc1727302b0e1e255ea5cf4e2ccf33cafe7296 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sat, 28 Oct 2017 18:19:33 -0500 Subject: import: cpan: Add trailing "/" on home-page. This appeases 'guix lint', which otherwise complains about permanent redirects. * guix/import/cpan.scm (cpan-module->sexp): Add trailing "/" on home-page. * tests/cpan.scm ("cpan->guix-package"): Adjust accordingly. --- guix/import/cpan.scm | 2 +- tests/cpan.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 15b121e829..5ba1adf402 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -244,7 +244,7 @@ META." (convert-inputs '("configure" "build" "test"))) ,@(maybe-inputs 'propagated-inputs (convert-inputs '("runtime"))) - (home-page ,(string-append "http://search.cpan.org/dist/" name)) + (home-page ,(string-append "http://search.cpan.org/dist/" name "/")) (synopsis ,(assoc-ref meta "abstract")) (description fill-in-yourself!) (license ,(string->license (assoc-ref meta "license")))))) diff --git a/tests/cpan.scm b/tests/cpan.scm index 91e2cc6814..e5bd0ae3a4 100644 --- a/tests/cpan.scm +++ b/tests/cpan.scm @@ -97,7 +97,7 @@ ('propagated-inputs ('quasiquote (("perl-test-script" ('unquote 'perl-test-script))))) - ('home-page "http://search.cpan.org/dist/Foo-Bar") + ('home-page "http://search.cpan.org/dist/Foo-Bar/") ('synopsis "Fizzle Fuzz") ('description 'fill-in-yourself!) ('license 'perl-license)) -- cgit v1.2.3 From 73f33b93797383a356133a2e871af9c07f5b5376 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 29 Oct 2017 15:28:35 +0100 Subject: import: cpan: Add trailing "/" to CPAN-HOME. Prevent regression after commit e4bc1727302b0e1e255ea5cf4e2ccf33cafe7296. * guix/import/cpan.scm (cpan-home): Add trailing "/". --- guix/import/cpan.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 5ba1adf402..b5dba2bc1c 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -115,7 +115,7 @@ or #f on failure. MODULE should be e.g. \"Test::Script\"" (json-fetch (string-append "https://fastapi.metacpan.org/v1/release/" name))) (define (cpan-home name) - (string-append "http://search.cpan.org/dist/" name)) + (string-append "http://search.cpan.org/dist/" name "/")) (define (cpan-source-url meta) "Return the download URL for a module's source tarball." -- cgit v1.2.3 From 6d176ad379e35b3a85da2fb74bc7d2053569602f Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 29 Oct 2017 15:51:28 +0100 Subject: import: cpan: Actually use CPAN-HOME. * guix/import/cpan.scm (cpan-module->sexp): Use the CPAN-HOME procedure. --- guix/import/cpan.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index b5dba2bc1c..2ef02c43a4 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2016 Alex Sassmannshausen +;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -244,7 +245,7 @@ META." (convert-inputs '("configure" "build" "test"))) ,@(maybe-inputs 'propagated-inputs (convert-inputs '("runtime"))) - (home-page ,(string-append "http://search.cpan.org/dist/" name "/")) + (home-page ,(cpan-home name)) (synopsis ,(assoc-ref meta "abstract")) (description fill-in-yourself!) (license ,(string->license (assoc-ref meta "license")))))) -- cgit v1.2.3 From 29f7bf59d5d4d4b848eaedc6766bb4e02cae20d3 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 29 Oct 2017 15:53:23 +0100 Subject: import: cpan: Use HTTPS for home pages. * guix/import/cpan.scm (cpan-home): Use HTTPS. * tests/cpan.scm ("cpan->guix-package"): Expect it. --- guix/import/cpan.scm | 2 +- tests/cpan.scm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 2ef02c43a4..792da0ab31 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -116,7 +116,7 @@ or #f on failure. MODULE should be e.g. \"Test::Script\"" (json-fetch (string-append "https://fastapi.metacpan.org/v1/release/" name))) (define (cpan-home name) - (string-append "http://search.cpan.org/dist/" name "/")) + (string-append "https://search.cpan.org/dist/" name "/")) (define (cpan-source-url meta) "Return the download URL for a module's source tarball." diff --git a/tests/cpan.scm b/tests/cpan.scm index e5bd0ae3a4..36712ceeb7 100644 --- a/tests/cpan.scm +++ b/tests/cpan.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Eric Bavier ;;; Copyright © 2016 Alex Sassmannshausen +;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -97,7 +98,7 @@ ('propagated-inputs ('quasiquote (("perl-test-script" ('unquote 'perl-test-script))))) - ('home-page "http://search.cpan.org/dist/Foo-Bar/") + ('home-page "https://search.cpan.org/dist/Foo-Bar/") ('synopsis "Fizzle Fuzz") ('description 'fill-in-yourself!) ('license 'perl-license)) -- cgit v1.2.3 From b5c7574b2f6fe7752b02eaaa8a745a35b3beb2a1 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 30 Oct 2017 13:28:10 +0100 Subject: Revert "import: cpan: Use HTTPS for home pages." This reverts commit 29f7bf59d5d4d4b848eaedc6766bb4e02cae20d3: HTTPS support at search.cpan.org is unreliable, at best. Don't rely on it. --- guix/import/cpan.scm | 2 +- tests/cpan.scm | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 792da0ab31..2ef02c43a4 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -116,7 +116,7 @@ or #f on failure. MODULE should be e.g. \"Test::Script\"" (json-fetch (string-append "https://fastapi.metacpan.org/v1/release/" name))) (define (cpan-home name) - (string-append "https://search.cpan.org/dist/" name "/")) + (string-append "http://search.cpan.org/dist/" name "/")) (define (cpan-source-url meta) "Return the download URL for a module's source tarball." diff --git a/tests/cpan.scm b/tests/cpan.scm index 36712ceeb7..e5bd0ae3a4 100644 --- a/tests/cpan.scm +++ b/tests/cpan.scm @@ -1,7 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Eric Bavier ;;; Copyright © 2016 Alex Sassmannshausen -;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -98,7 +97,7 @@ ('propagated-inputs ('quasiquote (("perl-test-script" ('unquote 'perl-test-script))))) - ('home-page "https://search.cpan.org/dist/Foo-Bar/") + ('home-page "http://search.cpan.org/dist/Foo-Bar/") ('synopsis "Fizzle Fuzz") ('description 'fill-in-yourself!) ('license 'perl-license)) -- cgit v1.2.3 From 63ae4800de4fcee20573024f0e7fffca7cbc8dc5 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 31 Oct 2017 00:49:32 +0100 Subject: download: Refresh the cpan.org mirror list. * guix/download.scm (%mirrors)[cpan]: Update the list of CPAN mirrors (of which several are dead) with a more-or-less geographically diverse selection. --- guix/download.scm | 77 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 21 deletions(-) (limited to 'guix') diff --git a/guix/download.scm b/guix/download.scm index 074322b24f..17dac3f8ef 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -176,28 +176,63 @@ "ftp://mirrors.go-part.com/xorg/" "http://x.cs.pu.edu.tw/" "ftp://ftp.is.co.za/pub/x.org") ; South Africa - (cpan ; from http://www.cpan.org/SITES.html - "http://mirror.ibcp.fr/pub/CPAN/" - "ftp://ftp.ciril.fr/pub/cpan/" - "ftp://artfiles.org/cpan.org/" + (cpan "http://www.cpan.org/" - "ftp://cpan.rinet.ru/pub/mirror/CPAN/" - "ftp://cpan.inode.at/" - "ftp://cpan.iht.co.il/" - "ftp://ftp.osuosl.org/pub/CPAN/" - "ftp://ftp.nara.wide.ad.jp/pub/CPAN/" - "http://mirrors.163.com/cpan/" - "ftp://cpan.mirror.ac.za/" - "http://cpan.mirrors.ionfish.org/" - "http://cpan.mirror.dkm.cz/pub/CPAN/" - "http://cpan.mirror.iphh.net/" - "http://mirrors.teentelecom.net/CPAN/" - "http://mirror.teklinks.com/CPAN/" - "http://cpan.weepeetelecom.be/" - "http://mirrors.xservers.ro/CPAN/" - "http://cpan.yimg.com/" - "http://mirror.yazd.ac.ir/cpan/" - "http://ftp.belnet.be/ftp.cpan.org/") + "http://cpan.metacpan.org/" + ;; A selection of HTTP mirrors from http://www.cpan.org/SITES.html. + ;; Europe. + "http://ftp.belnet.be/mirror/ftp.cpan.org/" + "http://mirrors.nic.cz/CPAN/" + "http://mirror.ibcp.fr/pub/CPAN/" + "http://ftp.ntua.gr/pub/lang/perl/" + "http://kvin.lv/pub/CPAN/" + "http://mirror.as43289.net/pub/CPAN/" + "http://cpan.cs.uu.nl/" + "http://cpan.uib.no/" + "http://cpan-mirror.rbc.ru/pub/CPAN/" + "http://mirror.sbb.rs/CPAN/" + "http://cpan.lnx.sk/" + "http://ftp.rediris.es/mirror/CPAN/" + "http://mirror.ox.ac.uk/sites/www.cpan.org/" + ;; Africa. + "http://mirror.liquidtelecom.com/CPAN/" + "http://cpan.mirror.ac.za/" + "http://mirror.is.co.za/pub/cpan/" + "http://cpan.saix.net/" + "http://mirror.ucu.ac.ug/cpan/" + ;; North America. + "http://mirrors.gossamer-threads.com/CPAN/" + "http://mirror.csclub.uwaterloo.ca/CPAN/" + "http://mirrors.ucr.ac.cr/CPAN/" + "http://www.msg.com.mx/CPAN/" + "http://mirrors.namecheap.com/CPAN/" + "http://mirror.uic.edu/CPAN/" + "http://mirror.datapipe.net/CPAN/" + "http://mirror.cc.columbia.edu/pub/software/cpan/" + "http://mirror.uta.edu/CPAN/" + ;; South America. + "http://cpan.mmgdesigns.com.ar/" + "http://mirror.nbtelecom.com.br/CPAN/" + "http://linorg.usp.br/CPAN/" + "http://cpan.dcc.uchile.cl/" + "http://mirror.cedia.org.ec/CPAN/" + ;; Oceania. + "http://cpan.mirror.serversaustralia.com.au/" + "http://mirror.waia.asn.au/pub/cpan/" + "http://mirror.as24220.net/pub/cpan/" + "http://cpan.lagoon.nc/pub/CPAN/" + "http://cpan.inspire.net.nz/" + ;; Asia. + "http://mirror.dhakacom.com/CPAN/" + "http://mirrors.ustc.edu.cn/CPAN/" + "http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/" + "http://kambing.ui.ac.id/cpan/" + "http://cpan.hostiran.ir/" + "http://ftp.nara.wide.ad.jp/pub/CPAN/" + "http://mirror.neolabs.kz/CPAN/" + "http://cpan.nctu.edu.tw/" + "http://cpan.ulak.net.tr/" + "http://mirrors.vinahost.vn/CPAN/") (cran ;; Arbitrary mirrors from http://cran.r-project.org/mirrors.html ;; This one automatically redirects to servers worldwide -- cgit v1.2.3