From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wIDRMy3EA2LJOwAAgWs5BA (envelope-from ) for ; Wed, 09 Feb 2022 14:39:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eGKFLC3EA2LMFgAAG6o9tA (envelope-from ) for ; Wed, 09 Feb 2022 14:39:57 +0100 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 7359E1D85E for ; Wed, 9 Feb 2022 14:39:57 +0100 (CET) Received: from localhost ([::1]:52172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnCO-0005w0-Iz for larch@yhetil.org; Wed, 09 Feb 2022 08:39:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmy9-0004df-TS for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56279) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmxy-0004EH-Nt for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:11 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmxy-00076U-JD; Wed, 09 Feb 2022 08:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 3/7] http-client: 'http-fetch/cached' accepts a string or a . Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441308327251 (code B ref 53818); Wed, 09 Feb 2022 13:25:02 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:24:43 +0000 Received: from localhost ([127.0.0.1]:50174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmxf-00075T-7v for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:43 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44858 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmxd-00075E-JL for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:41 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413076; bh=H8jADRyKH0fzq5VeA6Xl0rjl0GKGDAUsZO7ia0nN2ho=; h=From:To:Subject:In-Reply-To:References:Date; b=jQePeU76TZV3KTL2/3Ju/7y6F2mCKv9yGgRdadinjXY62d4dlh6BFJME+MwE1B/vt zTml6ypXPuQuEVtS5I1wpNkHoEdXaHu7eNy3OHd+Z5wodHbx4TFvjZQVpDwdxbyILY a+wpf8c8oJbogF/xXnT8QorGeCPu/Csxr/fn+kxo= In-Reply-To: References: Message-Id: <7be659f7ef029ee77df683f3f522f9f51fe40ba5.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:24:35 +0100 MIME-Version: 1.0 Content-Type: text/plain 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644413997; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=H8jADRyKH0fzq5VeA6Xl0rjl0GKGDAUsZO7ia0nN2ho=; b=g8UgJtoK6ApTBQ7IYhZlRQV2Hv/hrpB9xO7GvEpuMDtUoFFEa9lVTh1pIuLjsuy9CjTiA4 joQoEQPZ/9A/rBUngw7hA+DfBtccm8jjP2IKIF5Ng47GdJRfqOY6dx3pMA+ARjPpCTIgZR lBdx1AzHvh5bQBKVAb4E+lkdvMEtT9Pz8pw7BIUJee07ypYc/GELnkPLnpvUxFx0IwWDmR tOf3ZpFL/9kdq+5FWmbu1Tk9bpXPoUeerWBWUdbsVCcmoXE3MfI4hnMibFAJPl2RwVAPi+ NLQqF5dR65jCiIXE++8eub6msXOO45Qjnx5qMZLzLhVx28BYCWmBTEtk2SrZ9Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644413997; a=rsa-sha256; cv=none; b=qjkp8B3QNWW10du5JOyTPK9mp/W7dEDTjJ5RhPY1JsTpQGPR2vBY9vxo9d9GENBhYVdrTQ G1F6v02w6mkOErAs7Ss5dEb5vbCI/BU/eW8lBWltkPNI9GHNYwiJB1M4P/15+MAKZq4YU8 DjSFny1ayH7nlMY9/eAYaVda3nwa3iXEZm1YS8SqUh33CieXNgpDJTXfmKi2ByEveF25j3 OIyksIvYuOuWcUe+V7tOHv9X2Nsj41lmxyrkTULMJXK96L1e5hl6kPxt7aO/I95uX2Th83 +TGBhPI/Q0JMe0siRvi9MzKAXnsA7+wHQAbxujsGnGxTxI7Tts8poXcFML+0vQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=jQePeU76; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (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: -1.83 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=jQePeU76; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (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: 7359E1D85E X-Spam-Score: -1.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: jgmqxjSKPOzF This is consistent with the 'http-fetch' procedure. * guix/http-client.scm (http-fetch/cached): The 'uri' argument can be a string or a record. --- guix/http-client.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/http-client.scm b/guix/http-client.scm index 058f09852f..08efdd5e47 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -297,7 +297,10 @@ (define* (http-fetch/cached uri #:key (ttl (%http-cache-ttl)) text? TIMEOUT specifies the timeout in seconds for connection establishment. Write information about redirects to LOG-PORT." - (let ((file (cache-file-for-uri uri))) + (let* ((uri (if (string? uri) + (string->uri uri) + uri)) + (file (cache-file-for-uri uri))) (define (update-cache cache-port) (define cache-time (and cache-port -- 2.34.1