guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/11: guix hash: Allow '-r' as a non-deprecated alias.


From: guix-commits
Subject: 02/11: guix hash: Allow '-r' as a non-deprecated alias.
Date: Mon, 10 Jan 2022 16:29:46 -0500 (EST)

lfam pushed a commit to branch wip-linux-libre-5.16
in repository guix.

commit c1aa0ee9bdbdd229bba50dec6d1c0f41bff7b8d2
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jan 10 17:43:52 2022 +0100

    guix hash: Allow '-r' as a non-deprecated alias.
    
    This is a followup to 05c962594c346da21f201be72caadfa19060cc9d.
    
    Discussed at <https://issues.guix.gnu.org/51307#24>.
    
    * guix/scripts/hash.scm (%options): Warn about deprecation for
    "--recursive", but not for '-r' as it's a convenient shorthand.  Mention
    '--serializer=nar' in the deprecation message.
    * doc/guix.texi (Invoking guix hash): Adjust accordingly.
---
 doc/guix.texi         | 7 ++++---
 guix/scripts/hash.scm | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ab9f17b29f..390c4347d6 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11827,11 +11827,12 @@ in the definitions of packages.
 
 @item --recursive
 @itemx -r
-This option is deprecated in favor of @option{--serializer}.  It is a
-legacy alias for that with @var{type} set to @code{nar}.
+The @option{--recursive} option is deprecated in favor of
+@option{--serializer=nar} (see below); @option{-r} remains accepted as a
+convenient shorthand.
 
 @item --serializer=@var{type}
-@itemx -S
+@itemx -S @var{type}
 Compute the hash on @var{file} using @var{type} serialization.
 
 @var{type} may be one of the following:
diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm
index 9715dc7779..4e792c6a03 100644
--- a/guix/scripts/hash.scm
+++ b/guix/scripts/hash.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2016, 2017, 2020, 2021 Ludovic Courtès 
<ludo@gnu.org>
+;;; Copyright © 2012-2014, 2016-2017, 2020-2022 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
@@ -134,8 +134,9 @@ and 'base16' ('hex' and 'hexadecimal' can be used as 
well).\n"))
                               (alist-delete 'format result))))
         (option '(#\r "recursive") #f #f
                 (lambda (opt name arg result)
-                  (warning (G_ "'--recursive' is deprecated, \
-use '--serializer' instead~%"))
+                  (unless (eqv? name #\r)
+                    (warning (G_ "'--recursive' is deprecated, \
+use '--serializer=nar' instead~%")))
                   (alist-cons 'serializer nar-hash
                               (alist-delete 'serializer result))))
         (option '(#\S "serializer") #t #f



reply via email to

[Prev in Thread] Current Thread [Next in Thread]