From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KOSsGSbEA2KAGgAAgWs5BA (envelope-from ) for ; Wed, 09 Feb 2022 14:39:50 +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 wOJjEibEA2Lb3wAAG6o9tA (envelope-from ) for ; Wed, 09 Feb 2022 14:39:50 +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 0CF1D14289 for ; Wed, 9 Feb 2022 14:39:50 +0100 (CET) Received: from localhost ([::1]:51336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnCH-0005Gt-5t for larch@yhetil.org; Wed, 09 Feb 2022 08:39:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmy9-0004dd-T4 for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmxx-0004E3-Ot 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 1nHmxx-00076E-Ly; Wed, 09 Feb 2022 08:25:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 1/7] upstream: Sort list of updaters. 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:01 +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.164441305127186 (code B ref 53818); Wed, 09 Feb 2022 13:25:01 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:24:11 +0000 Received: from localhost ([127.0.0.1]:50168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmx8-00074P-MV for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:10 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44826 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmx7-000749-Oe for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:10 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413044; bh=uePA9eU3rVfA9D2Eoe6XklIGhmYCp8Bpq3h/n9/hOOk=; h=From:To:Subject:In-Reply-To:References:Date; b=piFvX2WkUE1M1DgHLzOs8GXc/OEfIFmX9GG+w2aXe2yxqy+styolguiqbm2M2ZoS7 aEvWJeobXGepvFnKylduL7f+/LD4viEXKx48RlhGaKYBmaBf9jFEdrk7Th2NuBM/5+ OhcRzI3qAbJdlcyJZXukv63b/O19QJZMoIIkfPQE= In-Reply-To: References: Message-Id: <0f119f2aaf1f3d492bdf733136c310a9f1a6d85d.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:24:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1644413990; 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: 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=uePA9eU3rVfA9D2Eoe6XklIGhmYCp8Bpq3h/n9/hOOk=; b=kI9xMCKvQq/X7Q7N0f45TxC1b0aHtlH4TeQt1ERhphae/GO9xiQO6nqOkVvIERxpM5m9aB L28z8eMrlPb1jXEU9ZSDJ/bV0+DBknYPGMPMQlBnGVo/B/lHxiQJgN5XHPCbCcyREomZyV E3SUC1UdpDJGc1H26Kk1mtiTmxez1tca2sU9n8f1vs4XUKdGWjd25tB77a33mFfniuXZCf WplwtwvuluyXYhMWWhxFxoKux3L6Dyh0y0Cg9zdJbghCwVY2LZU2ULNHpULgdj4jtjyE+Z nD4ngLSM7ZWIiYr+T1LFLyDPZFge9UPCQl1lq/siPhMvtawTGkz7UP9CmkAt2Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644413990; a=rsa-sha256; cv=none; b=bhSsyDTPJ+GdV4PBL3MeCRmI/dqR9RuPqzLY2i2moNJJcX1NzXQSwgQ7zSUcqNaFgEzW15 gGJZuaESbxcJuQ54BuV1g1tbKXXDK1f3ugyM7jot2ZMREEiL/kdcWDmfmteD5ipfXxG/r+ OMj8Lh04SNySM69opfWyl5bScUsMglaFIkZ9nOM5ARvMqtZC2Y5MgxXOctZX/tD2KeOc3J lOzVaOLFB4W5E3v0VtcJmSTVD1LUFaGfNSrPJJrq67ER49p5JUNO3incLY2JAdBxg2WV3M WX16GEl2kBbUxJr/giN3FieLLOFH8kZ6kOwbRb8b2gr/91lo5JYqn+5kkqe5Zw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=piFvX2Wk; 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=piFvX2Wk; 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: 0CF1D14289 X-Spam-Score: -1.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: Jy1MHjmrHjRm The order determines which updater gets used first when running =E2=80=98gu= ix refresh=E2=80=99 on a package. We want the most generic updaters to be last since they usua= lly don=E2=80=99t provide as much or accurate information as language-specific = updaters. * guix/upstream.scm (sort-updaters): New procedure. (%updaters): Use it. --- guix/upstream.scm | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/guix/upstream.scm b/guix/upstream.scm index 6666803a92..d5faf9d3ee 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -250,14 +250,31 @@ (define (importer-modules) %load-path) #:warn warn-about-load-error))) =20 +(define (sort-updaters updaters) + "Sort UPDATERS by putting the more generic ones last." + (define (genericity updater) + (cond + ((equal? 'repology (upstream-updater-name updater)) + 2) + ((string-prefix? "generic-" + (symbol->string (upstream-updater-name updater))) + 1)=20=20=20=20=20 + (else 0))) + + (define (less a b) + (<=3D (genericity a) (genericity b))) + + (stable-sort updaters less)) + (define %updaters ;; The list of publically-known updaters. - (delay (fold-module-public-variables (lambda (obj result) - (if (upstream-updater? obj) - (cons obj result) - result)) - '() - (importer-modules)))) + (delay (sort-updaters + (fold-module-public-variables (lambda (obj result) + (if (upstream-updater? obj) + (cons obj result) + result)) + '() + (importer-modules))))) =20 ;; Tests need to mock this variable so mark it as "non-declarative". (set! %updaters %updaters) --=20 2.34.1