From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qFVDCsvHA2IvTQAAgWs5BA (envelope-from ) for ; Wed, 09 Feb 2022 14:55:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wEKcBsvHA2KR/QAAauVa8A (envelope-from ) for ; Wed, 09 Feb 2022 14:55:23 +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 DBE7C12D34 for ; Wed, 9 Feb 2022 14:55:22 +0100 (CET) Received: from localhost ([::1]:59686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnRJ-00049X-At for larch@yhetil.org; Wed, 09 Feb 2022 08:55:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHn7m-0003EF-S2 for guix-patches@gnu.org; Wed, 09 Feb 2022 08:35:10 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHn7e-0005yc-28 for guix-patches@gnu.org; Wed, 09 Feb 2022 08:35:10 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHn7d-0007P2-TZ for guix-patches@gnu.org; Wed, 09 Feb 2022 08:35:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53828] [PATCH] guix: opam: Allow importing local files. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53828 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller , 53828@debbugs.gnu.org Received: via spool by 53828-submit@debbugs.gnu.org id=B53828.164441367728414 (code B ref 53828); Wed, 09 Feb 2022 13:35:01 +0000 Received: (at 53828) by debbugs.gnu.org; 9 Feb 2022 13:34:37 +0000 Received: from localhost ([127.0.0.1]:50221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHn7E-0007OE-Qh for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:34:37 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:45112 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHn7C-0007Ny-Mq for 53828@debbugs.gnu.org; Wed, 09 Feb 2022 08:34:35 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413667; bh=Nfp2sQyD6omxmgUzxidtXObgtYHd09dljafUtZAsYR4=; h=From:To:Subject:In-Reply-To:References:Date; b=jYqbYctwua8hnzOLL7vMcMZqnxFUzPzEKRmdLOWc33bEa68d8m4vaRjdTQskECzN/ K8VXS6eLSL39jJUWUUq0gZc1elUoT7S0GpylLNAlHfGhOnRr8egUR+yN8ghwUUG5T/ JZqsOpOnb81VDgY4/XjMnnU1e1DDhbbVydWp0m1M= In-Reply-To: References: <20220206224130.2220aae9@tachikoma.lepiller.eu> <87k0e713pg.fsf@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:34:25 +0100 Message-ID: <87tud8w4da.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" 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=1644414922; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=Nfp2sQyD6omxmgUzxidtXObgtYHd09dljafUtZAsYR4=; b=G1m2W5XO5GOgXxBypfz4RKeavwa3GUB9FCQN8THPOiffGWQ+2y3Dum32rSM1T2cfcwtjB8 l+olkI1nRiuwbsYQAvWJgVlXrFhNAVqI7y6IiX3/hJ//UFsOfemBhdJCeEhy2zwiiPRf6f EzIVGsqKxrIyyZiHZBNOHQj67a7FxyW38U/g/HvR6CJkLcd/pFLAuCNlmVUjDbNML6yVts 584KdCdaB/MTQ2wPXEgSlxAPVbyCyyIBT2brFoAx46NnAzeGp8I16jIAHEQKb7J74vaSK0 PvH8jB6Dh8IE3IfB6YNJ5hijULQBQX48G6aWyS6hxy6UaDHxKnpnx+tIbwI7yA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644414922; a=rsa-sha256; cv=none; b=YCeleVDTTWZ/Gl5gOuI+sfSyljMrei7Oyxj3nqwjnkcjvwXyfrF2GNMg0sog5KzLo3pj+7 1XrNw8fDZm3LwW6ZZgl+uxgFAIDhV4hRfKIdONAO1k9MiiUxGwkaIGoLygyalt9kAYJagb LoWiEgpddh+OatC7EVcmM4kH49o4zuGS+QBMC2TKkK59tobTP4XRYiPMXa85FZnw7L8Ize u1LN0J2jkWwMTgKQaVRGjH4wUIHtFn6+FU9/c2JpPBUSGZS8d7dNeasULp/BVrreoVxR3H akITcyMUOLX5X9cmXIMsANDDJ/c1dCvtmoAXE6j7Fki7KN/DG0VNIonXYvztLw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=jYqbYctw; 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: -4.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=jYqbYctw; 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: DBE7C12D34 X-Spam-Score: -4.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: wLUpeY7CnaXZ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Julien schrieb am Montag der 07. Februar 2022 um 09:46 +01: >>> +(define (opam->guix-source url-dict) >>> + (let ((source-url (and url-dict >>> + (or (metadata-ref url-dict "src") >>> + (metadata-ref url-dict "archive"))))) >>> + (if source-url >>> + (call-with-temporary-output-file >>> + (lambda (temp port) >>> + (and (url-fetch source-url temp) >>> + `(origin >>> + (method url-fetch) >>> + (uri ,source-url) >>> + (sha256 (base32 ,(guix-hash-url temp))))))) >>> + 'no-source-information))) >> >>I would use =E2=80=98and-let*=E2=80=99 instead of =E2=80=98let=E2=80=99, = and drop the =E2=80=98if=E2=80=99 form. > > That would return #f and make the ocher and-let* in opam->guix-package > fail. Right, I missed the =E2=80=98and-let*=E2=80=99 in =E2=80=98opam->guix-packa= ge=E2=80=99. However, seeing as the =E2=80=98source=E2=80=99 variable is only used in the body of the = =E2=80=98and-let*=E2=80=99, I think it would make sense to not even bind the result of =E2=80=98opam->guix-source=E2=80=99 to any variable, instead using it direc= tly in the =E2=80=98package=E2=80=99 form. `(package =E2=80=A6 (source ,source) =E2=80=A6) becomes `(package =E2=80=A6 (source ,(opam->guix-source (metadata-ref opam-content "url"))) =E2=80=A6) WDYT? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmIDwuEVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5yJYQALpJEYSpJUAkAn7NtkD2v7qvC2q/ VOXdrxDv6T9hMUE62OVe+Tqfy1PIwCVCFeHDldaHg+GrGONig5bFfSeqN/QpsjGp K4qU2HiA5XUwoDtpXtSBaNgAiJtFQ8FWc95EwPAM1sM1FDDwq31uQDIcaBp8xIiS f8bvOm6RaOJFYvYecWpqhOkfEjkm6hjBKW5BKnhQGis/ItTPlT17m7TFZ5E/BOSu Wi699NBbaXPqk65OSYozMt514cKwED5zNEtDmCKHtmAJX7CQ//0+Zb/cciqysbgH FcjhnaR2/CPfg2lI2xiQrVEaAWHG8Ymzw2bMFtvmMVPxk/OTTt6e570QUuQvXr1l JZV6p1Jn3UB93NpE4EDPhmsKrtMlCPva64bBMdaRwG65+/i/UL82sr909TDZPKM5 FruC+l918rIESBJcEuOOYGHJRb6yomeI6UmkH30++PgwIvJWIxpdwBgUN8XgHEb3 MWWGzsrurbaO4zatPNFC68b5/pkwONfadFXSQyn2osaVXDLzrwRBkjN190YMkJbw gL/KKi99BxWtxd3VE0WVzWhhU8i4dDlRZLtpPfriaSt+W/bwc9ewd6j3+EtrOjlo eDnPUvlk7veRROLHjSkA3a4P7u0eeEQxD/kuICzg915yDmJ04Cee92zJiUgaXFnO 7EjqITOt2RX/hQdK =RitB -----END PGP SIGNATURE----- --=-=-=--