From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 10:23:56 2022 Received: (at submit) by debbugs.gnu.org; 11 Sep 2022 14:23:56 +0000 Received: from localhost ([127.0.0.1]:43093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXNsK-00019Q-9M for submit@debbugs.gnu.org; Sun, 11 Sep 2022 10:23:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:56520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXNsI-00019J-NK for submit@debbugs.gnu.org; Sun, 11 Sep 2022 10:23:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXNsI-00054a-I2 for guix-patches@gnu.org; Sun, 11 Sep 2022 10:23:54 -0400 Received: from michel.telenet-ops.be ([2a02:1800:110:4::f00:18]:34166) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXNsG-0004Ez-8G for guix-patches@gnu.org; Sun, 11 Sep 2022 10:23:54 -0400 Received: from localhost.localdomain ([188.189.36.122]) by michel.telenet-ops.be with bizsmtp id JePf280042e7A3g06ePfJT; Sun, 11 Sep 2022 16:23:39 +0200 From: Maxime Devos To: guix-patches@gnu.org Subject: [PATCH] gnu-maintenance: Support // URLs in latest-html-release Date: Sun, 11 Sep 2022 16:23:37 +0200 Message-Id: <20220911142337.1208-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1662906219; bh=sYrar1XbHM/IC0Kcq/voNyhkXQJDSro/KjztxMv3xFg=; h=From:To:Cc:Subject:Date; b=MFhbGz9+52RRLx0rUU7oskyKQOLkPGxQ/6sWdL/e6H6ZJVL7Jfso+MpcnDXg5dTjc 1wAYQqsgVh0O4n4fviAZVYixgJkm0uwKdpjggPqVU/IrfBYSZIBvRHHVAEmRtXXLa+ 5k/dzhUbhDHq/40FNSmaplcaHaXx0H3bzZ9KTdbpiGBirMy78ORGEqnLbkgwiPiGeu TxVQWbFW0EcKsvq9JciWnuK0m145Rq1RF0PVNAuixY7ID1Ewbz/BOYeDARRe/6O+nT C6y/6B5XiYzVAC9odK6xiaBKJdX7FWfiwk0eJabvj75Kvqoj22RGuZTsKFckOMgClP T0glU8GF1K4cQ== Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: submit Cc: Maxime Devos X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This makes "./pre-inst-env guix refresh -u" download the release tarball from the right place -- previously, it downloaded from https://www.libreoffice.org//download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1 whereas it should download from https://download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1 instead. * guix/gnu-maintenance.scm (latest-html-release)[url-release]: Adjust computation in the case of an absolute URI-reference without a scheme. * tests/gnu-maintenance.scm ("latest-html-release, scheme-less URIs"): Test it. --- guix/gnu-maintenance.scm | 7 +++++++ tests/gnu-maintenance.scm | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index e7edbf6656..1ffa408666 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2012, 2013 Nikita Karetnikov ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -499,6 +500,12 @@ (define (url->release url) (base-url (string-append base-url directory)) (url (cond ((and=> (string->uri url) uri-scheme) ;full URL? url) + ;; full URL, except for URI scheme. Reuse the URI + ;; scheme of the document that contains the link. + ((string-prefix? "//" url) + (string-append + (symbol->string (uri-scheme (string->uri base-url))) + ":" url)) ((string-prefix? "/" url) ;absolute path? (let ((uri (string->uri base-url))) (uri->string diff --git a/tests/gnu-maintenance.scm b/tests/gnu-maintenance.scm index c04d8ba733..89b0684c25 100644 --- a/tests/gnu-maintenance.scm +++ b/tests/gnu-maintenance.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2021 Ludovic Courtès +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,6 +19,10 @@ (define-module (test-gnu-maintenance) #:use-module (guix gnu-maintenance) + #:use-module (guix tests) + #:use-module (guix tests http) + #:use-module (guix upstream) + #:use-module (guix utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-64) #:use-module (ice-9 match)) @@ -55,4 +60,28 @@ (define-module (test-gnu-maintenance) ("mpg321_0.3.2.orig.tar.gz" "0.3.2") ("bvi-1.4.1.src.tar.gz" "1.4.1"))))) +(test-assert "latest-html-release, scheme-less URIs" + (with-http-server + `((200 " + +Releases (on another domain)! + +version 1 + +")) + (let () + (define package + (dummy-package "foo" + (source + (dummy-origin + (uri (string-append (%local-url) "/foo-1.tar.gz")))) + (properties + `((release-monitoring-url . ,(%local-url)))))) + (define update ((upstream-updater-latest %generic-html-updater) package)) + (define expected-new-url "http://another-site/foo-2.tar.gz") + (and (pk 'u update) + (equal? (upstream-source-version update) "2") + (equal? (list expected-new-url) (upstream-source-urls update)))))) + (test-end) base-commit: a44e08337d15b3f254a35d0311663c2bbd501852 prerequisite-patch-id: 0caac311875ee39cb48573657ebb960e90da6dfb prerequisite-patch-id: 418285493d89ebf102175902d9b09a0174e88190 prerequisite-patch-id: 3c39eb839d9d3ff3fca6cd98621a5d5c411b7af4 prerequisite-patch-id: 8d5662e874c469f5ee496ef5181cf2d0a30ad1d8 prerequisite-patch-id: 26513c3b3b86963df718ee41d14a25d1cc6a8f3f prerequisite-patch-id: 2b2497e2edec0afc48ebadd6f09f0c661c466127 prerequisite-patch-id: 2712efb97bf33985fd0658e4dd8e936dc08be5fe prerequisite-patch-id: 9d2409b480a8bff0fef029b4b095922d4957e06f prerequisite-patch-id: 51a32abca3efec1ba67ead59b8694c5ea3129ad3 -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 17 13:22:01 2022 Received: (at 57732-done) by debbugs.gnu.org; 17 Sep 2022 17:22:02 +0000 Received: from localhost ([127.0.0.1]:47104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZbVx-0007J9-CM for submit@debbugs.gnu.org; Sat, 17 Sep 2022 13:22:01 -0400 Received: from mira.cbaines.net ([212.71.252.8]:41488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZbVu-0007Iz-MZ for 57732-done@debbugs.gnu.org; Sat, 17 Sep 2022 13:21:59 -0400 Received: from localhost (unknown [134.157.22.165]) by mira.cbaines.net (Postfix) with ESMTPSA id 4132327BBE9; Sat, 17 Sep 2022 18:21:58 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 167b1b7f; Sat, 17 Sep 2022 17:21:58 +0000 (UTC) References: <20220911142337.1208-1-maximedevos@telenet.be> User-agent: mu4e 1.8.9; emacs 28.1 From: Christopher Baines To: Maxime Devos Subject: Re: [bug#57732] [PATCH] gnu-maintenance: Support // URLs in latest-html-release Date: Sat, 17 Sep 2022 19:21:25 +0200 In-reply-to: <20220911142337.1208-1-maximedevos@telenet.be> Message-ID: <87tu55rk5l.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57732-done Cc: 57732-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Maxime Devos writes: > This makes "./pre-inst-env guix refresh -u" download the release tarball from > the right place -- previously, it downloaded from > > https://www.libreoffice.org//download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1 > > whereas it should download from > > https://download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1 > > instead. > > * guix/gnu-maintenance.scm (latest-html-release)[url-release]: Adjust > computation in the case of an absolute URI-reference without a scheme. > * tests/gnu-maintenance.scm ("latest-html-release, scheme-less URIs"): > Test it. > --- > guix/gnu-maintenance.scm | 7 +++++++ > tests/gnu-maintenance.scm | 29 +++++++++++++++++++++++++++++ > 2 files changed, 36 insertions(+) Looks good to me :) Pushed to master as c967d1153cae419e4acbe0dbed8f558d95ced0e3. Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmMmAjZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xcoag//RI8k/o4fUPZFTtM45ry84Y+wIcn1UMYq ja6IlElr7FfZr0rkY2gwcmTMiJuflvg3BDfLn3K3qfwJn2Tflv8I5uaiZZ8bV67u lDo4e6PY/7wFzr5XkZ22ifxhXIlJIvCaEk7+tAmd89SREmeuwlLTsQfr/uD2WEJJ 40vWHc3/nYnnJXnNApKklj7VuoszW2hD3MEavQlGXIzLTYCggEtb894DtPC3baH9 9LFXuW8tsgF7kx7v+vpxDaWBRSx32Bxg36hebDfOZwFQm4blPmpVfTMqDvoxrVAx 9Rb4PFdA+KFJTJsY+hnkO2oeo+E+E7+b7GgeD4euQj5k56nI6sLJwmBiWghNJL/6 7Lerw3tPcJZpbyi2RhYTD0w/FK8RXJ7wRouH0Vgrwkyj+8pryPZVnyqpUkpJd1I9 52TZ7KE1F25A5/73xeppVIEZG06g+25QGr/ck0ANiNWYCCgiYOa8/VewFxYXua0n c4p/hDbAUoR1jEAHLa099PRJm0hn1CYqH5N7R9NqKj54Ve9wPQHU8crlCSiSCxFC JtTZ1uJJQxVewxuAFB3fKLQGfSZqcIqDEGhtxW9S2lOeLnw+bo1EIKJGKWTlZLio bxe+K2BK6Vr7P1rMI3saFZlNevpJTQW4VP0rS5WbBxdjRjT/+1UXa0yFammqQraf o3cMVvfdz+0= =R562 -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Aug 15 01:55:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 16 Oct 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator