From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4ea1::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qLtCMeljyGEKngAAgWs5BA (envelope-from ) for ; Sun, 26 Dec 2021 13:45:29 +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 kJZYK+ljyGEZPwEAG6o9tA (envelope-from ) for ; Sun, 26 Dec 2021 13:45:29 +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 572181CDDA for ; Sun, 26 Dec 2021 13:45:29 +0100 (CET) Received: from localhost ([::1]:40340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1Su0-0004lf-Ar for larch@yhetil.org; Sun, 26 Dec 2021 07:45:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1Sta-0004lV-NH for guix-patches@gnu.org; Sun, 26 Dec 2021 07:45:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1StZ-0000ja-ND for guix-patches@gnu.org; Sun, 26 Dec 2021 07:45:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n1StZ-00020w-KP for guix-patches@gnu.org; Sun, 26 Dec 2021 07:45:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52774] [PATCH] import: elpa: Also check NonGNU ELPA for updates. References: <87wnjub5y6.fsf@yoctocell.xyz> Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 26 Dec 2021 12:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52774 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler , 52774@debbugs.gnu.org Received: via spool by 52774-submit@debbugs.gnu.org id=B52774.16405226867703 (code B ref 52774); Sun, 26 Dec 2021 12:45:01 +0000 Received: (at 52774) by debbugs.gnu.org; 26 Dec 2021 12:44:46 +0000 Received: from localhost ([127.0.0.1]:40337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1StK-00020B-0P for submit@debbugs.gnu.org; Sun, 26 Dec 2021 07:44:46 -0500 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:49258 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1StH-0001zr-V4 for 52774@debbugs.gnu.org; Sun, 26 Dec 2021 07:44:45 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1640522676; bh=d2wRikRUkZUqXEVYb5J9yNktpBaUCL/ftD0XYTRwA8c=; h=From:To:Subject:In-Reply-To:Date; b=uUrym/bNHjdAq7jJE0eGEEUuTN/0O5ddovT6SGrGevczX+9DPTjMhEqxUABNXAt1N Hyh6D8R3XYqH8au7y8pxcBOqUx//28NwSw2ak/OfMxEh9avTGOEzq896A824mJ8Upl x03aOkbd14eabC5AbktRwQrFltfvdwlJHxEFdxho= In-Reply-To: <5ba4b071c95b0db888ad3290d1aa569e979acec5.camel@gmail.com> Date: Sun, 26 Dec 2021 13:44:34 +0100 Message-ID: <87ee5zbknh.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=1640522729; 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=d2wRikRUkZUqXEVYb5J9yNktpBaUCL/ftD0XYTRwA8c=; b=eV8ET2xm7uLOClbABpTIb+GOpYabsJm8V0H0Y4HUtjrjiUX62BC+ylHF3uUev8p1iOREbR X1vIEyky7q3a2XD1yEsNLYEKhKMd7Fa4utAsS08yJw+Big4UY6bAjABiejvU0y0nTgu51F Enkh0gjp6pqD0beMF8+rxeuZWUaOgEuLAnDClTBaZtt/tli3j/KkH0op1DzhAXOEQIoPFE hDSJQxeFWJHIDIa1EBLw4a4j35M6JPMRx+Jc3F5VUTw4RHwKyN02zFNfhqnZkWBrK2JlkE witc695LEi524pEU1c9eDuPpgDsZTHFP4SZpr8txBf1Kp37JfurPR6FWR54IrA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640522729; a=rsa-sha256; cv=none; b=HQEHkm4GT6g/rY/CtCIFsdefuGnp4Oa6po5K2PLEucuEl965/lACwXsGlYcoln5d6rsWKC zZM7GCPWQgw5iUX20SeVBG9B7gyqb8+tzeO9BoQ0qz90IWFvaGkFpXgJkKDpjt8+c0TAgn xwwE4j6u4J4U8jQAj5eRa9RMX5rIi7c6eN0rPxHIKgavzsnokLA8GoNhEWIKrJpaW86GmS XFSKmhr7JkWdUm7WbjT5i2Haq/apTvki7y+07lULXjZQsCrbMBx14nAQLhUgflAc5bimjQ iJKgJwUVHM8U38jk0PqKH/R54skxeUqHjKyrU3fX21xlxJ/l2oUT47c6fxWFVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b="uUrym/bN"; 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.06 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b="uUrym/bN"; 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: 572181CDDA X-Spam-Score: -4.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: ZJo+woSdgIqN --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Liliana schrieb am Samstag der 25. Dezember 2021 um 16:23 +01: > Am Samstag, dem 25.12.2021 um 15:31 +0100 schrieb Xinglu Chen: >> Liliana schrieb am Samstag der 25. Dezember 2021 um 11:15 +01: >>=20 >> > Am Samstag, dem 25.12.2021 um 10:44 +0100 schrieb Xinglu Chen: >> > > Liliana schrieb am Freitag der 24. Dezember 2021 um 13:17 +01: >> > >=20 >> > > > Am Freitag, dem 24.12.2021 um 12:25 +0100 schrieb Xinglu Chen: >> > > > > * elpa.scm (latest-release): Determine the repository based >> > > > > on >> > > > > the URL of the source. >> > > > > (package-from-gnu.org?): Rename to ... >> > > > > (package-from-gnu.org-or-nongnu.org?): ...this. >> > > > > (%elpa-updater): Adjust accordingly. >> > > > > --- >> > > > > =C2=A0guix/import/elpa.scm | 13 +++++++++---- >> > > > > =C2=A01 file changed, 9 insertions(+), 4 deletions(-) >> > > > >=20 >> > > > > diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm >> > > > > index edabb88b7a..038379e01b 100644 >> > > > > --- a/guix/import/elpa.scm >> > > > > +++ b/guix/import/elpa.scm >> > > > > @@ -424,7 +424,11 @@ (define (guix-package->elpa-name >> > > > > package) >> > > > > =C2=A0(define (latest-release package) >> > > > > =C2=A0=C2=A0 "Return an for the latest releas= e of >> > > > > PACKAGE." >> > > > > =C2=A0=C2=A0 (define name (guix-package->elpa-name package)) >> > > > > -=C2=A0 (define repo 'gnu) >> > > > > +=C2=A0 (define repo >> > > > > +=C2=A0=C2=A0=C2=A0 (let ((url (origin-uri (package-source packa= ge)))) >> > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (string-prefix? "https://elp= a.nongnu.org" url) >> > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'nongnu >> > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'gnu))) >> > > > > =C2=A0 >> > > > > =C2=A0=C2=A0 (match (elpa-package-info name repo) >> > > > > =C2=A0=C2=A0=C2=A0=C2=A0 (#f >> > > > > @@ -443,11 +447,12 @@ (define repo 'gnu) >> > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (urls (list url= )) >> > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (signature-urls= (list (string-append url >> > > > > ".sig")))))))) >> > > > > =C2=A0 >> > > > > -(define package-from-gnu.org? >> > > > > +(define package-from-gnu.org-or-nongnu.org? >> > > > > =C2=A0=C2=A0 (url-predicate (lambda (url) >> > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((uri (string->uri= url))) >> > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and uri >> > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (string=3D? (uri-host uri) >> > > > > "elpa.gnu.org")))))) >> > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (or (string=3D? (uri-host uri) >> > > > > "elpa.gnu.org") >> > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string=3D? (uri-host uri) >> > > > > "elpa.nongnu.org"))))))) >> > > > > =C2=A0 >> > > > > =C2=A0(define %elpa-updater >> > > > > =C2=A0=C2=A0 ;; The ELPA updater.=C2=A0 We restrict it to packag= es hosted on >> > > > > elpa.gnu.org >> > > > > @@ -455,7 +460,7 @@ (define %elpa-updater >> > > > > =C2=A0=C2=A0 (upstream-updater >> > > > > =C2=A0=C2=A0=C2=A0 (name 'elpa) >> > > > > =C2=A0=C2=A0=C2=A0 (description "Updater for ELPA packages") >> > > > > -=C2=A0=C2=A0 (pred package-from-gnu.org?) >> > > > > +=C2=A0=C2=A0 (pred package-from-gnu.org-or-nongnu.org?) >> > > > > =C2=A0=C2=A0=C2=A0 (latest latest-release))) >> > > > > =C2=A0 >> > > > > =C2=A0(define elpa-guix-name (cut guix-name "emacs-" <>)) >> > > > >=20 >> > > > > base-commit: e8c1562599c7ebee8b7b228237fb0d75d4472a61 >> > > > Could we make it so that package-from-gnu.org? becomes elpa- >> > > > package? s.t. (member (elpa-package? pkg) '(gnu nongnu #f)) and >> > > > its >> > > > evaluation can be reused? >> > >=20 >> > > Wouldn=E2=80=99t it be enough with just '(gnu nongnu)? >> > >=20 >> > > We could make the =E2=80=98elpa-package?=E2=80=99 procedure memoized= to avoid >> > > evaluating the same thing twice. >> > The reason for #f is so that packages that are neither from GNU nor >> > NonGNU ELPA are still excluded from the updater. >>=20 >> I am not sure I follow.=C2=A0 If =E2=80=98elpa-package?=E2=80=99 returne= d #f, the >> following would return #f. >>=20 >> =C2=A0 (member (elpa-package? pkg) '(gnu nongnu)) >>=20 >> Meaning that PKG is not hosted on GNU or NonGNU ELPA, and thus, >> should not be checked for updates. >>=20 >> When including #f in the list, the value returned by the =E2=80=98member= =E2=80=99 >> expression would be '(#f), which means that PKG would be checked for >> updates, even though it shouldn=E2=80=99t. > I think you're misunderstanding what I'm saying, but that might be > because I worded it badly. My suggestion was to make elpa-package? a > "predicate with meaning", which returns #f if PKG is not an ELPA > package, and a truthy value otherwise, said truthy value being the > symbol 'gnu or 'nongnu at the moment That was what I had in mind as well, but I don=E2=80=99t see why we would n= eed '(gnu nongnu #f) instead of just '(gnu nongnu). If PKG is not in ELPA, we _don=E2=80=99t_ want to check for updates, and therefore, #f shouldn=E2= =80=99t be a member of the list. I took a stab at the problem (patch attached below), and the result seems to be what would be expected. =2D-8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix refresh -t elpa emacs-caml emacs-project emacs-helm gnu/packages/emacs-xyz.scm:10870:2: warning: no updater for emacs-helm = ;github gnu/packages/emacs-xyz.scm:636:13: 0.8.1 is already the latest version of e= macs-project ;gnu gnu/packages/emacs-xyz.scm:2751:13: 4.9 is already the latest version of em= acs-caml ;nongnu =2D-8<---------------cut here---------------end--------------->8--- --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-import-elpa-Also-check-NonGNU-ELPA-for-updates.patch Content-Transfer-Encoding: quoted-printable From=204332502000bd06a2be900c236666d10f07777807 Mon Sep 17 00:00:00 2001 Message-Id: <4332502000bd06a2be900c236666d10f07777807.1640522590.git.public= @yoctocell.xyz> From: Xinglu Chen Date: Thu, 23 Dec 2021 22:08:33 +0100 Subject: [PATCH] import: elpa: Also check NonGNU ELPA for updates. * elpa.scm (latest-release): Determine the repository based on the URL of t= he source. (package-from-gnu.org?): Rename to ... (elpa-repository): ...this; memoize. (elpa-package?): New procedure. (%elpa-updater): Adjust accordingly. =2D-- guix/import/elpa.scm | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index edabb88b7a..a03df5167e 100644 =2D-- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -44,6 +44,7 @@ (define-module (guix import elpa) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) + #:use-module (guix memoization) #:use-module ((guix utils) #:select (call-with-temporary-output-file)) #:export (elpa->guix-package guix-package->elpa-name @@ -424,7 +425,7 @@ (define (guix-package->elpa-name package) (define (latest-release package) "Return an for the latest release of PACKAGE." (define name (guix-package->elpa-name package)) =2D (define repo 'gnu) + (define repo (elpa-repository package)) =20 (match (elpa-package-info name repo) (#f @@ -443,11 +444,20 @@ (define repo 'gnu) (urls (list url)) (signature-urls (list (string-append url ".sig")))))))) =20 =2D(define package-from-gnu.org? =2D (url-predicate (lambda (url) =2D (let ((uri (string->uri url))) =2D (and uri =2D (string=3D? (uri-host uri) "elpa.gnu.org")))))) +(define elpa-repository + (memoize + (url-predicate (lambda (url) + (let ((uri (string->uri url))) + (and uri + (cond + ((string=3D? (uri-host uri) "elpa.gnu.org") + 'gnu) + ((string=3D? (uri-host uri) "elpa.nongnu.org") + 'nongnu) + (else #f)))))))) + +(define (elpa-package? package) + (member (elpa-repository package) '(gnu nongnu))) =20 (define %elpa-updater ;; The ELPA updater. We restrict it to packages hosted on elpa.gnu.org @@ -455,7 +465,7 @@ (define %elpa-updater (upstream-updater (name 'elpa) (description "Updater for ELPA packages") =2D (pred package-from-gnu.org?) + (pred elpa-package?) (latest latest-release))) =20 (define elpa-guix-name (cut guix-name "emacs-" <>)) base-commit: 2495582e08cf411163f0799d290fda5101141949 =2D-=20 2.33.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmHIY7IVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5ulYP/0Han5PVSxrQGGWchRJBocvUbjt9 fjeulL2/+Z5GgVnBkMHsGs2yN992i+6PamcUP52owK/UNG1BkAtpBN9f/IwDHL1t p5g+usU2O2bXf56zenpeGN4+qJFtUeoEWMbL1rwqHX9BwVJOQcGiongoY/KF7ti+ RePf80b97RC8i617KH5jm/ADGHrmERnXMfCQaQ///LOmEIPSJuxrATCKh4i/OUJm Pj1+eT6TCoWPcTEYF0p9ZJ7yNIMrc1+YL7QU/uFUN+f780L6ir2K8bOGD9Unyv8E 72cG/NpgrlipGx4JQ/Z6BtYFkPTwAptzFTrlT6CAWNs5Qt7h+amWG/ARjURwHX4u RXEpj0PD7MAhHsrjlU1W1+0odHPLFbh2ckdwxlXl3YYvMEV9cPlDJy0+jBQlLji2 oIsgM18g4jZu/aEfOXrsgh7Y/w4WvSDB0x2lTLIpAbsxX8LhGKErXKQM0W3GtOFn oJoAsDo+3dJMbynJRzxFArTAgeLe3u8NXltbhRyCjOf8fYb0apjcsKUvY0M7ultc 4+Sapu0crhSgieM5MAWzkWUKbvDnrRYFbhU3F79qilSorjfjtEjrc4DaPyi3HZ97 Pe7qk3aIFV2dQs7zmv2P/kE+j+adbIEOjA5joQFdOvwuPPUKpW3XG6vSJPL2yvzb nZ5Ma/RnBHlMMwTL =ppUj -----END PGP SIGNATURE----- --==-=-=--