guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: download: Cope with Guile 2.0.6 or earlier.


From: Mark H. Weaver
Subject: 01/01: download: Cope with Guile 2.0.6 or earlier.
Date: Wed, 25 Feb 2015 01:01:47 +0000

mhw pushed a commit to branch master
in repository guix.

commit c964a15d8239d28144be51868868aa21d5d4ddce
Author: Mark H Weaver <address@hidden>
Date:   Tue Feb 24 19:58:13 2015 -0500

    download: Cope with Guile 2.0.6 or earlier.
    
    * guix/build/download.scm: Do not attempt to support relative URIs in
      "Location" headers if 'declare-relative-uri-header!' is not present.
      This is the case for Guile 2.0.6 or earlier.
---
 guix/build/download.scm |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/build/download.scm b/guix/build/download.scm
index 16afb1d..e8d61e0 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -211,10 +211,12 @@ which is not available during bootstrap."
 (unless (or (> (string->number (major-version)) 2)
             (> (string->number (minor-version)) 0)
             (> (string->number (micro-version)) 11))
-  (let ((declare-relative-uri-header!
-         (module-ref (resolve-module '(web http))
-                     'declare-relative-uri-header!)))
-    (declare-relative-uri-header! "Location")))
+  (let ((var (module-variable (resolve-module '(web http))
+                              'declare-relative-uri-header!)))
+    ;; If 'declare-relative-uri-header!' doesn't exist, forget it.
+    (when (and var (variable-bound? var))
+      (let ((declare-relative-uri-header! (variable-ref var)))
+        (declare-relative-uri-header! "Location")))))
 
 (define (resolve-uri-reference ref base)
   "Resolve the URI reference REF, interpreted relative to the BASE URI, into a



reply via email to

[Prev in Thread] Current Thread [Next in Thread]