From patchwork Mon Aug 21 18:06:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 53080 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7AAB327BBEA; Mon, 21 Aug 2023 19:11:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8002427BBE2 for ; Mon, 21 Aug 2023 19:11:43 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qY9Mc-0005fW-1h; Mon, 21 Aug 2023 14:10:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qY9Ln-0005Ms-UJ for guix-patches@gnu.org; Mon, 21 Aug 2023 14:10:08 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY9Lm-0004su-Oc; Mon, 21 Aug 2023 14:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qY9Lm-0007Va-Mp; Mon, 21 Aug 2023 14:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65230] [PATCH v3 05/10] gnu-maintenance: Accept package object in 'import-html-release' procedure. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 21 Aug 2023 18:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65230 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65230@debbugs.gnu.org Cc: Maxim Cournoyer , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 65230-submit@debbugs.gnu.org id=B65230.169264135028679 (code B ref 65230); Mon, 21 Aug 2023 18:10:02 +0000 Received: (at 65230) by debbugs.gnu.org; 21 Aug 2023 18:09:10 +0000 Received: from localhost ([127.0.0.1]:57680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY9Kw-0007SS-3N for submit@debbugs.gnu.org; Mon, 21 Aug 2023 14:09:10 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:59897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY9Ks-0007R9-Vy for 65230@debbugs.gnu.org; Mon, 21 Aug 2023 14:09:07 -0400 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-76ce59842c1so201793185a.3 for <65230@debbugs.gnu.org>; Mon, 21 Aug 2023 11:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692641339; x=1693246139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fSvqP932FLPbM8fa3EzPSgM/uOJTV+oVvRl1fFsvuP4=; b=WJYmcwJUggTGNjz5xuCOP8bvHQzVmZMREqALUkiu/Dus0EdJEDtE4pI3b2TXC6JxvO LgACb/JDAanEb2q4SAQzBNuLqK28fK936E8RfhAckTP7qK88kZUL42AyWw/0sdPCV509 RgcSu52dQy5awR9nsqpubWq0yKjW+XflovLmWtbTETFOZjsLHGKdBTe93mOaan1QNJ2U gZaRa2sfOFBwSgvaMFS84wbm26xG1FjRlwcqiZstp6Rl8TwMHChIapokoy6ZRlGeDDZe Js5idX8zsVze0v6X8b2t4O5IsdBuT87ZqcZaFBH32qqMIVWjYr3asL9+dHO05GJuGyet Z54w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692641339; x=1693246139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fSvqP932FLPbM8fa3EzPSgM/uOJTV+oVvRl1fFsvuP4=; b=c4SyO25LglcQ06wdQokNoBJTBdJVJTE2kP/2lbpENgEO7fbfpH+WGGpWCq/3bc+/TP vp0JsQufXXRLQE1ZIryjK7UzoBq4opvO68OfAGMzrJOOfEJEiB4CAmedydk5Bw/AURid cKDCodd2qr7npK3xVffUeowpL6xdJ5Qn2urcvPkV3Ug5dxbukhZXkffCyl4esVggHIM1 iIchKL/JdMV95bZloV6n84ZxB5ZpIV2NFRog7WfWlVW6ftintV7OeP3TQbLoEtE8BDPf Fsp+x9duNvwBBiwKUZVglvOny75cfdXCViMwCFvLMtFy+OiWB2TJMQqtRqLXuFsFz2JJ Ly2w== X-Gm-Message-State: AOJu0YzuEx0xVq0lTI7n60ufGH8Bx5y+0MyJagnklLaPiQOaxy7nyhM6 tKcfbq4yXzhWwIS9dHkUgXLNYlCUJoU= X-Google-Smtp-Source: AGHT+IHU9IyPP/PUIe4vGBV0P432JuvlWFJNrroIF+GcTrOylsNtEBkPU3Bw+n3mYmu5t11HHv/QXQ== X-Received: by 2002:a05:620a:3913:b0:76c:d4be:7c93 with SMTP id qr19-20020a05620a391300b0076cd4be7c93mr8185977qkn.20.1692641338801; Mon, 21 Aug 2023 11:08:58 -0700 (PDT) Received: from localhost.localdomain (dsl-10-148-105.b2b2c.ca. [72.10.148.105]) by smtp.gmail.com with ESMTPSA id t16-20020a05620a035000b00767303dc070sm2635523qkm.8.2023.08.21.11.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 11:08:58 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 21 Aug 2023 14:06:09 -0400 Message-ID: <7d7a0eb99954ffcf862634983fa7298df071fa5a.1692641173.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <5465490ad96f27fecbb69f9bd6f1607d29af6c23.1692641173.git.maxim.cournoyer@gmail.com> References: <5465490ad96f27fecbb69f9bd6f1607d29af6c23.1692641173.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is in preparation for a new URL rewriting feature, which will need to have the current version information available. * guix/gnu-maintenance.scm (import-html-release): Update doc. Adjust default value of the DIRECTORY argument. Bind PACKAGE in lexical scope so that its value there is unchanged. (import-savannah-release, import-kernel.org-release) (import-html-updatable-release): Adjust accordingly. --- (no changes since v1) guix/gnu-maintenance.scm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 67abbc1c5a..13d6c1c7f2 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -494,11 +494,12 @@ (define (url->links url) (define* (import-html-release base-url package #:key (version #f) - (directory (string-append "/" package)) + (directory (string-append + "/" (package-upstream-name package))) file->signature) - "Return an for the latest release of PACKAGE (a string) -under DIRECTORY at BASE-URL, or #f. Optionally include a VERSION string to -fetch a specific version. + "Return an for the latest release of PACKAGE under +DIRECTORY at BASE-URL, or #f. Optionally include a VERSION string to fetch a +specific version. BASE-URL should be the URL of an HTML page, typically a directory listing as found on 'https://kernel.org/pub'. @@ -507,7 +508,8 @@ (define* (import-html-release base-url package if any. Otherwise, FILE->SIGNATURE must be a procedure; it is passed a source file URL and must return the corresponding signature URL, or #f it signatures are unavailable." - (let* ((url (if (string-null? directory) + (let* ((package (package-upstream-name package)) + (url (if (string-null? directory) base-url (string-append base-url directory "/"))) (links (url->links url))) @@ -730,7 +732,6 @@ (define* (import-savannah-release package #:key (version #f)) (match (origin-uri (package-source package)) ((? string? uri) uri) ((uri mirrors ...) uri)))) - (package (package-upstream-name package)) (directory (dirname (uri-path uri)))) ;; Note: We use the default 'file->signature', which adds ".sig", ".asc", ;; or whichever detached signature naming scheme PACKAGE uses. @@ -825,7 +826,6 @@ (define* (import-kernel.org-release package #:key (version #f)) (match (origin-uri (package-source package)) ((? string? uri) uri) ((uri mirrors ...) uri)))) - (package (package-upstream-name package)) (directory (dirname (uri-path uri)))) (import-html-release %kernel.org-base package #:version version @@ -869,8 +869,7 @@ (define* (import-html-updatable-release package #:key (version #f)) "://" (uri-host uri)))) (directory (if custom "" - (dirname (uri-path uri)))) - (package (package-upstream-name package))) + (dirname (uri-path uri))))) (false-if-networking-error (import-html-release base package #:version version