From patchwork Wed Apr 16 16:41:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: jgart X-Patchwork-Id: 41718 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B073227BC4B; Wed, 16 Apr 2025 17:43:49 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A6C8A27BC49 for ; Wed, 16 Apr 2025 17:43:47 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u55rI-0001Ki-Mx; Wed, 16 Apr 2025 12:43:32 -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 1u55r8-00017Q-5r for guix-patches@gnu.org; Wed, 16 Apr 2025 12:43:25 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u55r7-0008Ey-6W; Wed, 16 Apr 2025 12:43:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=JD6+KLBN7hKijzfoZ2/AtG3yIMSAuTsdcJHk5VgiycA=; b=ERQtABQoP+eFkXHRQzzyCnG/q5SbkwgY9Nr8gLNKzeWET2s4gwcAnGxFeTF9L9yQpoNzOUWxTv0K9MriELXcbba+I2yMba7hao1Bwtxqxv32uJWc+HBWB5MD+PLmqtt3DBbT/TFrHz4JQYEowK8mH1nPdRk3wjT7z63yIPIQHwuHUCpMqTD0qt0hrtD3E8in4efdb/odMsNG1VbGuuk1ZqZeeWv5udURb6dkMV9tKRuFDzKDgp7kACHNGnBBbylxn0XfdNgzQdFWgn52oGt5Tp9V8jImdry68LW0tHI2jcmn2MFQNGVT86YFJ3y5B8ZqWjsmky+2STFctqtUg+nB+g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u55qs-0004E1-Ab; Wed, 16 Apr 2025 12:43:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77844] [PATCH] import/elpa: Improve CLI documentation for archive flag. Resent-From: jgart Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, csantosb@inventati.org, guix@cbaines.net, divya@subvertising.org, hako@ultrarare.space, ian@retrospec.tv, dev@jpoiret.xyz, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 16 Apr 2025 16:43:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77844 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77844@debbugs.gnu.org Cc: jgart , Andrew Tropin , Cayetano Santos , Christopher Baines , Divya Ranjan Pattanaik , Hilton Chain , Ian Eure , Josselin Poiret , Katherine Cox-Buday , Liliana Marie Prikler , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Andrew Tropin , Cayetano Santos , Christopher Baines , Divya Ranjan Pattanaik , Hilton Chain , Ian Eure , Josselin Poiret , Katherine Cox-Buday , Liliana Marie Prikler , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.174482177616124 (code B ref -1); Wed, 16 Apr 2025 16:43:04 +0000 Received: (at submit) by debbugs.gnu.org; 16 Apr 2025 16:42:56 +0000 Received: from localhost ([127.0.0.1]:41063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u55qh-0004Bt-P9 for submit@debbugs.gnu.org; Wed, 16 Apr 2025 12:42:56 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60462) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u55qb-00048V-8y for submit@debbugs.gnu.org; Wed, 16 Apr 2025 12:42:53 -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 1u55qI-0000Wm-4F for guix-patches@gnu.org; Wed, 16 Apr 2025 12:42:33 -0400 Received: from mx1.dismail.de ([78.46.223.134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u55qE-0007yR-Hv for guix-patches@gnu.org; Wed, 16 Apr 2025 12:42:28 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 8c757e0f for ; Wed, 16 Apr 2025 18:42:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=20190914; bh=Y5R76akGDTqfWdmEunClC HN0jJdvVBQewebgL0/X/SI=; b=ubqvat1fxUC1zBCCxCOpQyd+jMkXLtrM2+w5p pGMQppRd1wYr+W2pTCyEwCSJxs661v9dSQqKPu86wBLPGoNFGzPHw8tsafk6NW2W osiOrkezpCb8xJuwlRQfTrq+sn9sObrmChWRqBxgXqBEvGLvjTQ5TWF2FIuOihOd YQ8NhJ6lv3tokULD6dv+1P/x2G0gisJHydbH0ldDm8XiOQIcd8FrUteKrCec8ooa +Zm2ggGHaumnxeDgi6uHIDM7HBkY5GAxWTy5EH7NEO9AteTFcvOHlkre8WNnvw/I xgDbMDZcJcdBzRuZwFFw5sIHhG5ZtTEr5yi7VZm6v66sv7Ahw== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 8b19037c for ; Wed, 16 Apr 2025 18:42:20 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id f1a1a78e for ; Wed, 16 Apr 2025 18:42:20 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 60c5976e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Apr 2025 18:42:19 +0200 (CEST) Date: Wed, 16 Apr 2025 11:41:50 -0500 Message-ID: X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Received-SPF: pass client-ip=78.46.223.134; envelope-from=jgart@dismail.de; helo=mx1.dismail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham 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: jgart X-ACL-Warn: , jgart via Guix-patches X-Patchwork-Original-From: jgart via Guix-patches via From: jgart Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/elpa.scm (%elpa-archives): Add new global variable listing the elpa archives. * guix/scripts/import/elpa.scm: Use %elpa-archives in CLI documentation and reference it from the archives list in the default options global variable. Change-Id: Ib686bd9ff5eff2d4c37b8751ec1410666d568c1f --- guix/import/elpa.scm | 17 ++++++++++------- guix/scripts/import/elpa.scm | 10 +++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) base-commit: c2af5487988b57ba80edb45f75a39152f8c49745 diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index ea16885d90..eda3d6d60b 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2025 jgart ;;; ;;; This file is part of GNU Guix. ;;; @@ -51,6 +52,7 @@ (define-module (guix import elpa) #:use-module (guix memoization) #:export (elpa->guix-package guix-package->elpa-name + %elpa-archives %elpa-updater elpa-recursive-import)) @@ -81,15 +83,16 @@ (define (elpa-name->package-name name) (string-downcase name) (string-append package-name-prefix (string-downcase name))))) +(define %elpa-archives + '((gnu . "https://elpa.gnu.org/packages") + (gnu/http . "http://elpa.gnu.org/packages") ;for testing + (nongnu . "https://elpa.nongnu.org/nongnu") + (melpa-stable . "https://stable.melpa.org/packages") + (melpa . "https://melpa.org/packages"))) + (define* (elpa-url #:optional (repo 'gnu)) "Retrieve the URL of REPO." - (let ((elpa-archives - '((gnu . "https://elpa.gnu.org/packages") - (gnu/http . "http://elpa.gnu.org/packages") ;for testing - (nongnu . "https://elpa.nongnu.org/nongnu") - (melpa-stable . "https://stable.melpa.org/packages") - (melpa . "https://melpa.org/packages")))) - (assq-ref elpa-archives repo))) + (assq-ref %elpa-archives repo)) (define* (elpa-fetch-archive #:optional (repo 'gnu)) "Retrieve the archive with the list of packages available from REPO." diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm index 7f77beaac0..be15b5d60e 100644 --- a/guix/scripts/import/elpa.scm +++ b/guix/scripts/import/elpa.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2023 Simon Tournier +;;; Copyright © 2025 jgart ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,13 +41,16 @@ (define-module (guix scripts import elpa) ;;; (define %default-options - '((repo . gnu))) + `((repo . ,(assq-ref %elpa-archives 'gnu)))) (define (show-help) (display (G_ "Usage: guix import elpa PACKAGE-NAME Import the latest package named PACKAGE-NAME from an ELPA repository.\n")) - (display (G_ " - -a, --archive=ARCHIVE specify the archive repository")) + (display + (format #f + (G_ " + -a, --archive=ARCHIVE archive repository must be one of ~{~a ~}") + (map first %elpa-archives))) (display (G_ " -h, --help display this help and exit")) (display (G_ "