GNU bug report logs - #51441
[PATCH] substitutes: keep base's uri-path for Properly construct URL.

Previous Next

Package: guix-patches;

Reported by: Z572 <873216071 <at> qq.com>

Date: Wed, 27 Oct 2021 14:12:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Z572 <873216071 <at> qq.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] substitutes: keep base's uri-path for Properly construct URL.
Date: Wed, 27 Oct 2021 21:53:55 +0800
[Message part 1 (text/plain, inline)]
Hello,

Sorry for my english, and i'm not sure ChangeLog is right.

https://mirror.sjtu.edu.cn/guix use customize script to mirror official
substitutes server, at /guix not in /  . narinfo-request will forget add /guix to url, so i
can't use substitutes from them, this patch fix it.

[0001-substitutes-keep-base-s-uri-path-for-Properly-constr.patch (text/x-patch, inline)]
From 7fe17965d5336d55ec8b1b7471cbbb34b12e9a0b Mon Sep 17 00:00:00 2001
From: Z572 <873216071 <at> qq.com>
Date: Wed, 27 Oct 2021 21:28:24 +0800
Subject: [PATCH] substitutes: keep base's uri-path for Properly construct URL.

substitutes (narinfo-request): keep BASE's uri-path for properly construct url.

some substitutes server don't use guix publish, them use customize scripts to
mirror official server, if them look likes https://example.com/guix ,
narinfo-request will lost /guix .
---
 guix/substitutes.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/substitutes.scm b/guix/substitutes.scm
index a5c554acff..bfbd29623e 100644
--- a/guix/substitutes.scm
+++ b/guix/substitutes.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014 Nikita Karetnikov <nikita <at> karetnikov.org>
 ;;; Copyright © 2018 Kyle Meyer <kyle <at> kyleam.com>
 ;;; Copyright © 2020 Christopher Baines <mail <at> cbaines.net>
+;;; Copyright © 2021 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -158,7 +159,8 @@ (define (narinfo-request cache-url path)
   "Return an HTTP request for the narinfo of PATH at CACHE-URL."
   (let* ((base (string->uri cache-url))
          (ref (build-relative-ref
-               #:path (string-append (store-path-hash-part path) ".narinfo")))
+               #:path (string-append (uri-path base) "/"
+                                     (store-path-hash-part path) ".narinfo")))
          (url (resolve-uri-reference ref base))
          (headers '((User-Agent . "GNU Guile"))))
     (build-request url #:method 'GET #:headers headers)))
-- 
2.33.1

[Message part 3 (text/plain, inline)]
-- 
over

This bug report was last modified 3 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.