From 7db3ff4a29415ccc4f781c3e2450deb97d51a26f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 23 Aug 2013 15:51:36 +0200 Subject: utils: Add `guile-version>?', and use it. This fixes Guile version comparisons when (version) has a vendor-specific suffix. Reported by Andreas Enge . * guix/utils.scm (guile-version>?): New procedure. * tests/utils.scm ("guile-version>? 1.8", "guile-version>? 10.5"): New tests. * guix/scripts/substitute-binary.scm (fetch, progress-report-port): Use `guile-version>?' instead of `version>?'. * guix/http-client.scm (when-guile<=2.0.5, http-fetch): Likewise. --- guix/http-client.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix/http-client.scm') diff --git a/guix/http-client.scm b/guix/http-client.scm index 898b1669e5..11231cbc1e 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -133,7 +133,7 @@ (define bad-response (get-bytevector-all (response-port r)))))) ;; Install this patch only on Guile 2.0.5. - (when (version>? "2.0.6" (version)) + (unless (guile-version>? "2.0.5") (module-set! (resolve-module '(web response)) 'read-response-body read-response-body*))) @@ -163,7 +163,7 @@ (define* (http-fetch uri #:key port (text? #f) (buffered? #t)) ;; Try hard to use the API du jour to get an input port. ;; On Guile 2.0.5 and before, we can only get a string or ;; bytevector, and not an input port. Work around that. - (if (version>? (version) "2.0.7") + (if (guile-version>? "2.0.7") (http-get uri #:streaming? #t #:port port) ; 2.0.9+ (if (defined? 'http-get*) (http-get* uri #:decode-body? text? -- cgit v1.2.3