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 ms9.migadu.com with LMTPS id cC+gOEysJ2TE/QAASxT56A (envelope-from ) for ; Sat, 01 Apr 2023 06:00:13 +0200 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 iFnIN0ysJ2QXQQAAG6o9tA (envelope-from ) for ; Sat, 01 Apr 2023 06:00:12 +0200 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 3D2463C181 for ; Sat, 1 Apr 2023 06:00:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piSPO-0005yU-6O; Sat, 01 Apr 2023 00:00:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piSPL-0005yE-Ut for guix-patches@gnu.org; Sat, 01 Apr 2023 00:00:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piSPL-0001Pz-Ar for guix-patches@gnu.org; Sat, 01 Apr 2023 00:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piSPK-0004Wq-Lx for guix-patches@gnu.org; Sat, 01 Apr 2023 00:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62577] [PATCH] refresh: Support select packages SUBSET by module name. Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Apr 2023 04:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62577 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62577@debbugs.gnu.org Cc: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168032154817275 (code B ref -1); Sat, 01 Apr 2023 04:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Apr 2023 03:59:08 +0000 Received: from localhost ([127.0.0.1]:35029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piSOR-0004UY-Eq for submit@debbugs.gnu.org; Fri, 31 Mar 2023 23:59:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:46902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piSOP-0004UQ-6K for submit@debbugs.gnu.org; Fri, 31 Mar 2023 23:59:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piSOO-0005tx-PX for guix-patches@gnu.org; Fri, 31 Mar 2023 23:59:04 -0400 Received: from mail.envs.net ([5.199.136.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piSON-0001KC-6x for guix-patches@gnu.org; Fri, 31 Mar 2023 23:59:04 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 6FCDB38A008E; Sat, 1 Apr 2023 03:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1680321532; bh=eC5vKsHFIzfwLxni8sdkpzmtHAmTgQSx+jGV52qea58=; h=From:To:Cc:Subject:Date:From; b=bVf9VYkyntB6XWKt/fZxTK/Mov6ReSF/tSm85XlMB78B1b1JaYKl5Vfv32PD0F6iM KB9VP1jBJZ50yFxRqKplN7G6aEz4cScDLlKDwtZxkOqtR09TTPrhxXOuL0rPADpdbi XfzRKZoFlJVUcnVNoAt+Lvo26j1PQsvZalxWdClZjhUTi9pSvcUDmQfE2/6SHew9dN kOzbeSVs6cLRG8e9gZJNCCFEHZOPE6C7B0rpSqyeGJvW92qu7GywwI+/d8MMeX1GKn iX8RvcXrO94P5hKFtJFNnbdWQKxduvAuabqtKt+U9/5m/Sxs5FQh9Qsvhqazcqsomv SoQbBxfisOh/R0s4uAMog/RHn/wsv+0rPz4Xhd+0reeInr+v8K7wy2pzOiRrIarBJe V9AEEPlIb4DarXWeV608lyHSqy5oSp0g74srmIY49Ah018zmYWhbxqCZgNODhH4KcA LXtUBMje8JlpKnJhN75GvJiGWW0qGnb1fV9juwJrP2WA5TCOGj8nbzvlWal99rOzHB Qr+Ip9CKOGaeoDI2eDkmRsOKcW87k0hDl5sxYj1VrvbAi7PgfMoNiynl/lb6qWPQ6a 2emxydWZyUIiq7HF2BQeHPd5yljLbfNkT6FddoqmUNAEdGoBeo/DRKzZD8POIxV4cK Pdzw22GNlZxEgeVFULker4uk= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mYO3UmLfc3k6; Sat, 1 Apr 2023 03:58:49 +0000 (UTC) Received: from localhost (unknown [36.170.59.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Sat, 1 Apr 2023 03:58:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id ffe964bb; Sat, 1 Apr 2023 03:59:32 +0000 (UTC) Date: Sat, 1 Apr 2023 11:59:30 +0800 Message-Id: <20230401035930.3877-1-iyzsong@envs.net> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=5.199.136.28; envelope-from=iyzsong@envs.net; helo=mail.envs.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: , Reply-to: iyzsong@envs.net X-ACL-Warn: , iyzsong--- via Guix-patches From: iyzsong--- via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680321612; a=rsa-sha256; cv=none; b=HU+VF6zmSfwoAATGaXDI+DLPIrcdDQGwyfFVF/zC6vNPWl/z0F8EdpvRyz27m5kbho/OZr /1R0pvNyGfLnrVBnDuvv2kcjbDzSvFWIVCTXiEiLDdeCMxszC6aOiCl6AJXaZw5u5TEV18 Ujo7Sd3HTxOFl8AyVJ/1AKLXa2cRUd8Z0eG1fFgjNRxdeDUbRRs5TLWUs4qgU1ckSyoeiP 4jK7l0VcN5qR7eRcAVZzWFdICOMw34SoXufCG5ZGjE2Pm1k3PgEBNX1/xjH+w8ImNGpuPl oneWCCa3fmtdrpRVQnHh2vFUnyBfOD3uLqoCxOnP/DR4XVwd13/m5v1gSyLQ5A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=envs.net header.s=modoboa header.b=bVf9VYky; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680321612; h=from:from:sender:sender:reply-to: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=eC5vKsHFIzfwLxni8sdkpzmtHAmTgQSx+jGV52qea58=; b=KvNwmUW6li5PqJx2wXY4jhW/fZvVc2gMYkO9cKMI2eKbcjbXTK/NgPLiFMBq5D//t+X7Iu DfbA6itmLNUB4iBTt31Ih7JNJSHElQZkg0pdWQ9jQi4isWjDDhf7Xwm+QUvms4g2g5GXkS Hdr3p0V2RQpfVo/8BsUsc/zA+wDOjIFgksbLZh7AeHUgTEumlHzcvHIH9eB49d7pO7a0sz qh+w6xLeKAXndvNwC1NPFS8Sy2jMclm2JKJK8MwTWijlUds64L8iO51kKbbuDRgVvJXDBj PcWuY/iZhYf0Zw8VWascMuprgma5ncE4yycBBSkLiPvPFolQlG4pFOzzPmbDMA== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=envs.net header.s=modoboa header.b=bVf9VYky; dmarc=pass (policy=none) header.from=gnu.org; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.52 X-Spam-Score: -5.52 X-Migadu-Queue-Id: 3D2463C181 X-TUID: 2qO6j0o9EHZq From: 宋文武 * guix/scripts/refresh.scm (%options): Support '--select module:NAME'. (show-help): Adjust accordingly. (options->update-specs): Honor the module passed by '--select'. --- guix/scripts/refresh.scm | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index bc6c24967a..d6ac574b1f 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -32,6 +32,7 @@ (define-module (guix scripts refresh) #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) #:use-module (guix utils) + #:use-module (guix discovery) #:use-module (guix packages) #:use-module (guix profiles) #:use-module (guix upstream) @@ -71,8 +72,15 @@ (define %options ((or "core" "non-core") (alist-cons 'select (string->symbol arg) result)) + ((? (cut string-prefix? "module:" <>)) + (alist-cons 'select + (cons 'module + (string->symbol + (string-drop + arg (string-length "module:")))) + result)) (x - (leave (G_ "~a: invalid selection; expected `core' or `non-core'~%") + (leave (G_ "~a: invalid selection; expected `core', `non-core' or `module:NAME'~%") arg))))) (option '(#\t "type") #t #f (lambda (opt name arg result) @@ -141,8 +149,8 @@ (define (show-help) (display (G_ " -u, --update update source files in place")) (display (G_ " - -s, --select=SUBSET select all the packages in SUBSET, one of - `core' or `non-core'")) + -s, --select=SUBSET select all the packages in SUBSET, one of `core`, + `non-core' or `module:NAME' (eg: module:guile)")) (display (G_ " -m, --manifest=FILE select all the packages from the manifest in FILE")) (display (G_ " @@ -257,13 +265,20 @@ (define update-specs (let ((select? (match (assoc-ref opts 'select) ('core core-package?) ('non-core (negate core-package?)) - (_ (const #t))))) + (_ (const #t)))) + (modules (match (assoc-ref opts 'select) + (('module . mod) + (list (resolve-interface `(gnu packages ,mod)))) + (_ (all-modules (%package-module-path) + #:warn + warn-about-load-error))))) (map update-spec (fold-packages (lambda (package result) (if (select? package) (keep-newest package result) result)) - '())))) + '() + modules)))) (some ;user-specified packages some))) base-commit: 1c6238794b0058003fa6c827ca0d039764ebe699 -- 2.39.2