GNU bug report logs - #77844
[PATCH] import/elpa: Improve CLI documentation for archive flag.

Previous Next

Package: guix-patches;

Reported by: jgart <jgart <at> dismail.de>

Date: Wed, 16 Apr 2025 16:43:04 UTC

Severity: minor

Tags: patch

Done: jgart <jgart <at> dismail.de>

To reply to this bug, email your comments to 77844 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to andrew <at> trop.in, csantosb <at> inventati.org, guix <at> cbaines.net, divya <at> subvertising.org, hako <at> ultrarare.space, ian <at> retrospec.tv, dev <at> jpoiret.xyz, cox.katherine.e+guix <at> gmail.com, liliana.prikler <at> gmail.com, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#77844; Package guix-patches. (Wed, 16 Apr 2025 16:43:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to jgart <jgart <at> dismail.de>:
New bug report received and forwarded. Copy sent to andrew <at> trop.in, csantosb <at> inventati.org, guix <at> cbaines.net, divya <at> subvertising.org, hako <at> ultrarare.space, ian <at> retrospec.tv, dev <at> jpoiret.xyz, cox.katherine.e+guix <at> gmail.com, liliana.prikler <at> gmail.com, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org. (Wed, 16 Apr 2025 16:43:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: jgart <jgart <at> dismail.de>
To: guix-patches <at> gnu.org
Cc: jgart <jgart <at> dismail.de>
Subject: [PATCH] import/elpa: Improve CLI documentation for archive flag.
Date: Wed, 16 Apr 2025 11:41:50 -0500
* 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(-)

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 <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
+;;; Copyright © 2025 jgart <jgart <at> dismail.de>
 ;;;
 ;;; 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 <mjbecze <at> riseup.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2025 jgart <jgart <at> dismail.de>
 ;;;
 ;;; 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_ "

base-commit: c2af5487988b57ba80edb45f75a39152f8c49745
-- 
2.49.0





Reply sent to jgart <jgart <at> dismail.de>:
You have taken responsibility. (Wed, 16 Apr 2025 17:04:06 GMT) Full text and rfc822 format available.

Notification sent to jgart <jgart <at> dismail.de>:
bug acknowledged by developer. (Wed, 16 Apr 2025 17:04:07 GMT) Full text and rfc822 format available.

Message #10 received at 77844-done <at> debbugs.gnu.org (full text, mbox):

From: jgart <jgart <at> dismail.de>
To: 77844-done <at> debbugs.gnu.org
Cc: jgart <jgart <at> dismail.de>
Subject: Re: [PATCH] import/elpa: Improve CLI documentation for archive flag.
Date: Wed, 16 Apr 2025 12:02:51 -0500
Hi,

This has been superseded by 77845.

Closing,

jgart

> * 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(-)
> 
> 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 <iskarian <at> mgsn.dev>
>  ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
>  ;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
> +;;; Copyright © 2025 jgart <jgart <at> dismail.de>
>  ;;;
>  ;;; 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 <mjbecze <at> riseup.net>
>  ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
>  ;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
> +;;; Copyright © 2025 jgart <jgart <at> dismail.de>
>  ;;;
>  ;;; 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_ "
> 
> base-commit: c2af5487988b57ba80edb45f75a39152f8c49745
> -- 
> 2.49.0
<#secure method=pgpmime mode=sign>

-- 
all the best,
jgart




This bug report was last modified 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.