From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qJNoEInvHWMPEgAAbAwnHQ (envelope-from ) for ; Sun, 11 Sep 2022 16:24:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QFQpEInvHWN1pwAAauVa8A (envelope-from ) for ; Sun, 11 Sep 2022 16:24:09 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DF6CB33D9C for ; Sun, 11 Sep 2022 16:24:08 +0200 (CEST) Received: from localhost ([::1]:35068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXNsW-00056J-53 for larch@yhetil.org; Sun, 11 Sep 2022 10:24:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXNsR-00055m-7B for guix-patches@gnu.org; Sun, 11 Sep 2022 10:24:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXNsQ-0004FZ-LA for guix-patches@gnu.org; Sun, 11 Sep 2022 10:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXNsQ-00019r-G6 for guix-patches@gnu.org; Sun, 11 Sep 2022 10:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57732] [PATCH] gnu-maintenance: Support // URLs in latest-html-release Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Sep 2022 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57732 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57732@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16629062364435 (code B ref -1); Sun, 11 Sep 2022 14:24:02 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662906249; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=sYrar1XbHM/IC0Kcq/voNyhkXQJDSro/KjztxMv3xFg=; b=YbqbRIsNQM19+YNXT8a5tXsAcInaW9nL/xj5FmZJhcWXfB+vu1kVVtXL6zvCc1kBmtFYN0 wjnn6eEff7buo9UvE/Sk2y/MAf5ONi8dhRVY761LSPOYo0nz2dVtLLn32IshTfmrXZyLCH +5C40hX9e6l/+yaB3v7J3AfvawZkXBMWDFmka6flAMFY/em5fY94bZW5vv67TsakzY3DaD qI17q74CYXuaR7NfZDT5druWG4nhk/8w/abRE9zAm3X92+i9wcihN4qMLOiYdP3F/aeqlE tKsHTNJLuMkNBr7zskdAVkIL0e99EWnpOoeKn0eEp+W/rldyWLT2oRnhg+r9rg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662906249; a=rsa-sha256; cv=none; b=bmfU8ZNwdvguuQAOPL9x2vyOvGd0PCqK/lcARMJn5+lAStP0//LkBtQ/lSZYGMXML6gOp4 rWisWXUHtJpVUKUnGpemhgSbKQSr2S+XWITNwk+BWfP73PZVxLArajhrTAHW4a6wBzgCnu tWdLZiAWYfpj6fuVICHxyFDr8QLq4lKS3N6yQ5mKkSUcetuI/Jk0AL2pSPRIaesz4OiAL3 ICAp7mXSm02Vd139luvdXZVmjIfLWNCj6cphFHZSStiU4u2v1COCOHJO2/JUo6SGKplZ6z NZXlFqKs188oamPxRKoc7XdqpywP6Sng+u8fCRfwcQH35RtR/X0GtJL3WVqktA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=MFhbGz9+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 8.30 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=MFhbGz9+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DF6CB33D9C X-Spam-Score: 8.30 X-Migadu-Spam: Yes X-Migadu-Scanner: scn0.migadu.com X-TUID: V4zpRYhnRnAa 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