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 qBGnF5o3x2FuJgEAgWs5BA (envelope-from ) for ; Sat, 25 Dec 2021 16:24:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GPGAEZo3x2El+QAAG6o9tA (envelope-from ) for ; Sat, 25 Dec 2021 16:24:10 +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 ECD31C002 for ; Sat, 25 Dec 2021 16:24:09 +0100 (CET) Received: from localhost ([::1]:55100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n18u0-0001af-Ok for larch@yhetil.org; Sat, 25 Dec 2021 10:24:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n18tu-0001aT-LU for guix-patches@gnu.org; Sat, 25 Dec 2021 10:24:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n18tu-00032f-CL for guix-patches@gnu.org; Sat, 25 Dec 2021 10:24:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n18tu-00045r-3h for guix-patches@gnu.org; Sat, 25 Dec 2021 10:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52774] [PATCH] import: elpa: Also check NonGNU ELPA for updates. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Dec 2021 15:24:02 +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: Xinglu Chen , 52774@debbugs.gnu.org Received: via spool by 52774-submit@debbugs.gnu.org id=B52774.164044580915686 (code B ref 52774); Sat, 25 Dec 2021 15:24:02 +0000 Received: (at 52774) by debbugs.gnu.org; 25 Dec 2021 15:23:29 +0000 Received: from localhost ([127.0.0.1]:39695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n18tM-00044w-Qq for submit@debbugs.gnu.org; Sat, 25 Dec 2021 10:23:29 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n18tJ-00044b-Qa for 52774@debbugs.gnu.org; Sat, 25 Dec 2021 10:23:28 -0500 Received: by mail-wr1-f65.google.com with SMTP id a9so22774048wrr.8 for <52774@debbugs.gnu.org>; Sat, 25 Dec 2021 07:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=hHK7tlGM3k0E7OIQtfU9b4emS+v8Ml9UXZAtLJRgnoQ=; b=YKaOBci7IgP+3JlEAx9lCBYYjaySZXRd2gz2TyH8J7cNWFW9ASR4Lc5idLVMYqPpZ8 AcXnnhnUYVWyq3hK3NJ3PJn67KEfCbHPeCgKZyn5OrEslZe88hI95zWFiRhkvvOtNsP8 IGEt1ZcTBa7YlXXvH4P4IkxSSyAr+XHRlYGJ7VXZXww2OzPjpmZb3EBaFwSzprxAhPc0 ufhB3zp80uYNhs8N5DyuZEfiDPNQ8G2dvfqzsKOcMDty4zsK7d5MbvWwcne5UDVd45jw 9UXHe6L1VqkECIeOdPPB5fjaEt1zEK2r8wWeMQhiVf9xEF8ttociJ/VH+xmZ/2ulJVIZ onnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=hHK7tlGM3k0E7OIQtfU9b4emS+v8Ml9UXZAtLJRgnoQ=; b=dMP7jCBeuQ4Z1XRqkfcZA0dXSgDAARY+/6tO+kikg9Qq0PIrxVw0NXKH5RJ/mQ1qJt 2DaZFzvPgAhe/BWbyQV4zPtlJ8PdKWqknbWT9qYyu5bqe9NKXuP6TTiNZA44qVmHMy0z Jw0hMxiNPZfr+sHu+/tS1/5Kwi73UbjaPd6F3v0/yivf+Afqd+I5Z9yNzu1XFS8/MW/u wFLKKBw3vS9LKfliXXKy2BfdUuSbEiS/4G+X4zrdQcDjK7293t8cNdWIxO0O8m26b+x7 umkwshnsI7JKhuGhC+tRrWVGD6e8yprYk+k+fDbr0QP0SSZ2Gb2sHGRzb4hzGRPrFeBA rTZQ== X-Gm-Message-State: AOAM5309lLhqgIsdc3GFchJwzZfdeU7HwPuX8akfsA/zfu5Nw/nwh5Ft LDG6x6ng3342ndeNtZjTEWKz9Rias84Gjg== X-Google-Smtp-Source: ABdhPJxU31X36jMIVFpIbtW0L82UMPF0hznribB74d5j0pufaXHLOD6GbLBV1fXVFS6cFOeNi88YnA== X-Received: by 2002:adf:9146:: with SMTP id j64mr7473855wrj.487.1640445799947; Sat, 25 Dec 2021 07:23:19 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id u9sm13659151wmm.7.2021.12.25.07.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Dec 2021 07:23:19 -0800 (PST) Message-ID: <5ba4b071c95b0db888ad3290d1aa569e979acec5.camel@gmail.com> From: Liliana Marie Prikler Date: Sat, 25 Dec 2021 16:23:17 +0100 In-Reply-To: <87mtkobvsm.fsf@yoctocell.xyz> References: <87wnjub5y6.fsf@yoctocell.xyz> <76a91a888e6d4df4d46aa4dcc0fc3719c91e4c39.camel@gmail.com> <87r1a1auic.fsf@yoctocell.xyz> <0da0a9c2b0f6165712f0a81aab157833a79aecfc.camel@gmail.com> <87mtkobvsm.fsf@yoctocell.xyz> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 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" 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=1640445850; 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: content-transfer-encoding:content-transfer-encoding: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=hHK7tlGM3k0E7OIQtfU9b4emS+v8Ml9UXZAtLJRgnoQ=; b=rYZjhey2BiNBR4xOUpqbBYtlSfM27tExX5ns+eGv5KG5OO5TYZqZWMd2jqe7oJL3h/F3s7 /CVM6ERzUoU+8mlOfpRoJr5JNZLaosUVplusNyvz8whht675CzO9lwOffJUnHubFHsS+lz Z8hK1SaK9B+JzY+zLBOJZFeofvFovL3mY/ZiBbbObcP5RDck8GErHnxuUf8jkT1QCzxy6R dj1NVlzXwqjjizhePj43/DOaTnNS4Dym4aQRaiBKnXDYq9CXKrFpznuDX4Lb0FCngzlitQ 93luh+b4UMXBCtMGwgShVlKteL0aC6fsikp0jU1GYGQ83vpikhFCkwKzOlO5nQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640445850; a=rsa-sha256; cv=none; b=JVZ4NrB1PAZHaDyD+slT49A25aB0sV91EHnsa0VSydwgLFF7OlX0GvwoMRFV4eHXBg+Ufu 7LkKpUx9vIC3+Rh9Fii52GwtpWr4pk902WCani5UsB6JUQu9mckOiZtm/+39Nsweu/oZk+ JthjvrlI1uWWuVR3X6s2qi6awDIfQjQfWQoNK7sd0EMR3phbKPCiIsYBQvwUJKo6Dr6qOy OQvc95PIc2OknUjkmLECntyo2n9tIopE0lFI6KRaeUrr99slp1uBSBIkL22Z+jnRQGeswd y3DJtxArUxU7SJ/fxRbYes4gBV5jRP+xE+IQwanubeXdFjjV/XBbntavnvKvDQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=YKaOBci7; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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: -3.76 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=YKaOBci7; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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: ECD31C002 X-Spam-Score: -3.76 X-Migadu-Scanner: scn0.migadu.com X-TUID: pV3urHmaWzzU 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: > > > 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: > > > > > > > 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. > > > > > --- > > > > >  guix/import/elpa.scm | 13 +++++++++---- > > > > >  1 file changed, 9 insertions(+), 4 deletions(-) > > > > > > > > > > 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) > > > > >  (define (latest-release package) > > > > >    "Return an for the latest release of > > > > > PACKAGE." > > > > >    (define name (guix-package->elpa-name package)) > > > > > -  (define repo 'gnu) > > > > > +  (define repo > > > > > +    (let ((url (origin-uri (package-source package)))) > > > > > +      (if (string-prefix? "https://elpa.nongnu.org" url) > > > > > +          'nongnu > > > > > +          'gnu))) > > > > >   > > > > >    (match (elpa-package-info name repo) > > > > >      (#f > > > > > @@ -443,11 +447,12 @@ (define repo 'gnu) > > > > >          (urls (list url)) > > > > >          (signature-urls (list (string-append url > > > > > ".sig")))))))) > > > > >   > > > > > -(define package-from-gnu.org? > > > > > +(define package-from-gnu.org-or-nongnu.org? > > > > >    (url-predicate (lambda (url) > > > > >                     (let ((uri (string->uri url))) > > > > >                       (and uri > > > > > -                          (string=? (uri-host uri) > > > > > "elpa.gnu.org")))))) > > > > > +                          (or (string=? (uri-host uri) > > > > > "elpa.gnu.org") > > > > > +                              (string=? (uri-host uri) > > > > > "elpa.nongnu.org"))))))) > > > > >   > > > > >  (define %elpa-updater > > > > >    ;; The ELPA updater.  We restrict it to packages hosted on > > > > > elpa.gnu.org > > > > > @@ -455,7 +460,7 @@ (define %elpa-updater > > > > >    (upstream-updater > > > > >     (name 'elpa) > > > > >     (description "Updater for ELPA packages") > > > > > -   (pred package-from-gnu.org?) > > > > > +   (pred package-from-gnu.org-or-nongnu.org?) > > > > >     (latest latest-release))) > > > > >   > > > > >  (define elpa-guix-name (cut guix-name "emacs-" <>)) > > > > > > > > > > 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? > > > > > > Wouldn’t it be enough with just '(gnu nongnu)? > > > > > > We could make the ‘elpa-package?’ 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. > > I am not sure I follow.  If ‘elpa-package?’ returned #f, the > following would return #f. > >   (member (elpa-package? pkg) '(gnu nongnu)) > > Meaning that PKG is not hosted on GNU or NonGNU ELPA, and thus, > should not be checked for updates. > > When including #f in the list, the value returned by the ‘member’ > expression would be '(#f), which means that PKG would be checked for > updates, even though it shouldn’t. 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 (which could be expanded to e.g. include 'melpa or 'some-other-law-abiding-elpa in case the ELPA updater is found to work for those as well). Saying that it satisfies the above member function was a shorthand for that.