From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id AAQFBoGMSWfmXAAAe85BDQ:P1 (envelope-from ) for ; Fri, 29 Nov 2024 09:42:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id AAQFBoGMSWfmXAAAe85BDQ (envelope-from ) for ; Fri, 29 Nov 2024 10:42:25 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=q+NdJqvs; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=IfasRkxq; dmarc=pass (policy=none) header.from=gnu.org; 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" 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 A70938665F for ; Fri, 29 Nov 2024 10:42:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGxVo-0000fO-Ep; Fri, 29 Nov 2024 04:42:08 -0500 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 1tGxVk-0000eK-Ov for guix-patches@gnu.org; Fri, 29 Nov 2024 04:42:05 -0500 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 1tGxVk-0004Yu-CI; Fri, 29 Nov 2024 04:42:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=gUsH8apnherpQShGuu1InrWaP5q5OLB8UdwDPUoWXik=; b=q+NdJqvspzlPoSDLoAPVpr/78u99ydghOMEyca/J21Y7BeeWfeZiHhA+4H+FU9P3jJH5uYqOX7zrJxVyZr5Wb5bRspvH2yAhXm3iX1kwN/nKFgefzKitjctr3yk2NjfPUTFQBZ9FjI/Wk2IEO5bOkIB7PTvc7vS9PhoOb5MSJK5S7pqY/Yr7vctMehK0Vqt+eect6xMccKhfaERPuMrGNcgH+98hVLAqn73jkfBH2gmmTR+Hn/cTy8w8yHuw3/CUa4foz/APDPokwX111Gjo0G1XSgO88bPfersrYQtD69ZcE7rJHwBoqQbnOgCT6knGHrQ4bFtU/JGfIBca0GEIng==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGxVk-0005wQ-3N; Fri, 29 Nov 2024 04:42:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74542] [PATCH v2 02/16] gnu-maintenance: =?UTF-8?Q?=E2=80=98import-html-release=E2=80=99_?= =?UTF-8?Q?doesn=E2=80=99t?= abort upon HTTP 404. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 29 Nov 2024 09:42:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74542 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74542@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 74542-submit@debbugs.gnu.org id=B74542.173287326922615 (code B ref 74542); Fri, 29 Nov 2024 09:42:04 +0000 Received: (at 74542) by debbugs.gnu.org; 29 Nov 2024 09:41:09 +0000 Received: from localhost ([127.0.0.1]:41049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGxUq-0005sV-1K for submit@debbugs.gnu.org; Fri, 29 Nov 2024 04:41:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGxUd-0005pf-C2 for 74542@debbugs.gnu.org; Fri, 29 Nov 2024 04:40:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGxUU-0003mL-Dj; Fri, 29 Nov 2024 04:40:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=gUsH8apnherpQShGuu1InrWaP5q5OLB8UdwDPUoWXik=; b=IfasRkxqORU2gJgZQVA3 OkPnqfE3lh240KeBTru5nZD1Frs/G2Ofy6Ihx5fzlpBbsGGYqCq2xLcK/FSd9m5og5qOsG5wNJDUG 3jeRRAfU0SUL9Zjylhu0E7HJzE+9rks97wAYC27v8pqkIW2fFNnf/0lRt937/1mg4EUrK9Yw3MxKI YxOyN6yS58NY54iuzUovmClOlt0RAQf32UxWmmMpZ2cVQjYMiyMI2R6JgNap8ETU7Jc/qydQnYnpg dyhZ87g4VBWdceEgwQ6mPcUjUEXn2RL8gY7lxOB8bznSnxrx3l92gt6hadMDnhPsy88SuZcXvbCyb LaKKdMfDiWiD6g==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 29 Nov 2024 10:40:05 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 2.16 X-Spam-Score: 2.16 X-Migadu-Queue-Id: A70938665F X-Migadu-Scanner: mx12.migadu.com X-TUID: /0k+SVc4sjWx Previously, updaters using ‘import-html-release’ would throw to 'quit when the HTML page isn’t found, aborting the whole process: $ guix refresh coreutils libchop guix refresh: error: https://de.freedif.org/savannah//libchop/: HTTP download failed: 404 ("Not Found") * guix/gnu-maintenance.scm (url->links): Guard against ‘http-get-error?’ and return the empty list when it is raised. Change-Id: I419ff96ddb424aa8c74d6bab3d66a5e85355c3dc --- guix/gnu-maintenance.scm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 881e941fbf..f34dcfc13f 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2010-2023 Ludovic Courtès +;;; Copyright © 2010-2024 Ludovic Courtès ;;; Copyright © 2012, 2013 Nikita Karetnikov ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2022 Maxime Devos @@ -30,6 +30,7 @@ (define-module (guix gnu-maintenance) #:use-module (srfi srfi-2) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) #:use-module (rnrs io ports) #:use-module ((guix http-client) #:hide (open-socket-for-uri)) ;; not required in many cases, so autoloaded to reduce start-up costs. @@ -496,11 +497,16 @@ (define (html-links sxml) (define (url->links url) "Return the unique links on the HTML page accessible at URL." - (let* ((uri (string->uri url)) - (port (http-fetch/cached uri #:ttl 3600)) - (sxml (html->sxml port))) - (close-port port) - (delete-duplicates (html-links sxml)))) + (guard (c ((http-get-error? c) + (warning (G_ "failed to download '~a': ~a (~a)~%") + url (http-get-error-code c) + (http-get-error-reason c)) + '())) + (let* ((uri (string->uri url)) + (port (http-fetch/cached uri #:ttl 3600)) + (sxml (html->sxml port))) + (close-port port) + (delete-duplicates (html-links sxml))))) (define (canonicalize-url url base-url) "Make relative URL absolute, by appending URL to BASE-URL as required. If -- 2.46.0