GNU bug report logs - #37364
[PATCH 0/1] Add z for zsh

Previous Next

Package: guix-patches;

Reported by: "Collin J. Doering" <collin <at> rekahsoft.ca>

Date: Tue, 10 Sep 2019 02:41:01 UTC

Severity: normal

Tags: fixed, patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37364 in the body.
You can then email your comments to 37364 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to guix-patches <at> gnu.org:
bug#37364; Package guix-patches. (Tue, 10 Sep 2019 02:41:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Collin J. Doering" <collin <at> rekahsoft.ca>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 10 Sep 2019 02:41:01 GMT) Full text and rfc822 format available.

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

From: "Collin J. Doering" <collin <at> rekahsoft.ca>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/1] Add z for zsh
Date: Mon, 09 Sep 2019 22:40:13 -0400
Add the small zsh utility for quickly switching directories based on
past usage.

Collin J. Doering (1):
  gnu: Add z for zsh

 gnu/packages/shellutils.scm | 44 +++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

-- 
Collin J. Doering

http://rekahsoft.ca
http://blog.rekahsoft.ca
http://git.rekahsoft.ca




Information forwarded to guix-patches <at> gnu.org:
bug#37364; Package guix-patches. (Tue, 10 Sep 2019 02:46:01 GMT) Full text and rfc822 format available.

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

From: "Collin J. Doering" <collin <at> rekahsoft.ca>
To: 37364 <at> debbugs.gnu.org
Subject: [PATCH 1/1] gnu: Add z for zsh
Date: Mon, 09 Sep 2019 22:45:49 -0400
* gnu/packages/shellutils.scm (z): New variable.

Signed-off-by: Collin J. Doering <collin <at> rekahsoft.ca>
---
 gnu/packages/shellutils.scm | 44 +++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index f7542ea759..f4e8e0fbdb 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -33,11 +33,55 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages compression)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system python))
 
+(define-public z
+  (package
+    (name "z")
+    (version "1.11")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/rupa/z.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "13zbgkj6y0qhvn5jpkrqbd4jjxjr789k228iwma5hjfh1nx7ghyb"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("gzip" ,gzip)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'build)
+         (delete 'check)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (man-path (string-append out "/share/man/man1"))
+                    (install-path (string-append out "/bin")))
+               (mkdir-p install-path)
+               (copy-file "z.sh" (string-append install-path "/z.sh"))
+               (chmod (string-append install-path "/z.sh") #o755)
+
+               (mkdir-p man-path)
+               (invoke "gzip" "z.1")
+               (copy-file "z.1.gz" (string-append man-path "/z.1.gz"))
+               (chmod (string-append man-path "/z.1.gz") #o744)))))))
+    (synopsis "Jump about directories")
+    (description
+     "Tracks your most used directories, based on freecency.  After a short
+learning phase, z will take you to the most frecent directory that matches
+ALL of the regexes given on the command line in order.")
+    (home-page "https://github.com/rupa/z")
+    (license license:expat)))
+
 (define-public envstore
   (package
     (name "envstore")
-- 
2.23.0




Information forwarded to guix-patches <at> gnu.org:
bug#37364; Package guix-patches. (Tue, 10 Sep 2019 14:42:02 GMT) Full text and rfc822 format available.

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

From: "Collin J. Doering" <collin <at> rekahsoft.ca>
To: 37364 <at> debbugs.gnu.org
Subject: [PATCH] - Amended: Add copyright line and gpg sign email
Date: Tue, 10 Sep 2019 10:41:30 -0400
[Message part 1 (text/plain, inline)]
Did not add a copyright line to the modified file in this patch. I have
fixed this and updated the patch accordingly. Additionally I have signed
this email.

Kind regards,

-- 
Collin J. Doering

http://rekahsoft.ca
http://blog.rekahsoft.ca
http://git.rekahsoft.ca
[0001-gnu-Add-z-for-zsh.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#37364; Package guix-patches. (Wed, 11 Sep 2019 12:24:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "Collin J. Doering" <collin <at> rekahsoft.ca>
Cc: 37364 <at> debbugs.gnu.org
Subject: Re: [bug#37364] [PATCH 1/1] gnu: Add z for zsh
Date: Wed, 11 Sep 2019 14:23:17 +0200
Hello Collin,

"Collin J. Doering" <collin <at> rekahsoft.ca> skribis:

> * gnu/packages/shellutils.scm (z): New variable.
>
> Signed-off-by: Collin J. Doering <collin <at> rekahsoft.ca>

[...]

> +(define-public z
> +  (package
> +    (name "z")

So far there’s only one package with a one-letter name.  I’d be tempted
to rename “z” to “sh-z” (because it works with both Zsh and Bash) or
something similar, WDYT?

> +               (mkdir-p man-path)
> +               (invoke "gzip" "z.1")
> +               (copy-file "z.1.gz" (string-append man-path "/z.1.gz"))

You can omit the “gzip” invocation because the ‘compress-documentation’
phase takes care of that, and passes the ‘-n’ flag, which is important
for bitwise reproducibility.

Also, you can remove the ‘mkdir-p’ call and replace the ‘copy-file’ call
with:

  (install-file "z.1" man)

Last: please remove ‘-path’ from variable names—in GNU the convention is
touse the term “path” only for search paths ($PATH, etc.)

> +    (synopsis "Jump about directories")
> +    (description
> +     "Tracks your most used directories, based on freecency.  After a short
> +learning phase, z will take you to the most frecent directory that matches
> +ALL of the regexes given on the command line in order.")

It’s suggest writing “``frecency''” (with quotes) to make it clear that
it’s not a typo.  :-)

Could you send an updated patch?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#37364; Package guix-patches. (Thu, 12 Sep 2019 03:14:01 GMT) Full text and rfc822 format available.

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

From: "Collin J. Doering" <collin <at> rekahsoft.ca>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 37364 <at> debbugs.gnu.org, "Collin J. Doering" <collin <at> rekahsoft.ca>
Subject: Re: [bug#37364] [PATCH 1/1] gnu: Add z for zsh
Date: Wed, 11 Sep 2019 23:13:02 -0400
[Message part 1 (text/plain, inline)]
Hi Ludovic,

On 11 Sep 2019 at 08:23, Ludovic Courtès wrote:

> Hello Collin,
>
> "Collin J. Doering" <collin <at> rekahsoft.ca> skribis:
>
>> * gnu/packages/shellutils.scm (z): New variable.
>>
>> Signed-off-by: Collin J. Doering <collin <at> rekahsoft.ca>
>
> [...]
>
>> +(define-public z
>> +  (package
>> +    (name "z")
>
> So far there’s only one package with a one-letter name.  I’d be tempted
> to rename “z” to “sh-z” (because it works with both Zsh and Bash) or
> something similar, WDYT?

I felt uncomfortable with just `z` so I'm happy to change it to `sh-z`.

>
>> +               (mkdir-p man-path)
>> +               (invoke "gzip" "z.1")
>> +               (copy-file "z.1.gz" (string-append man-path "/z.1.gz"))
>
> You can omit the “gzip” invocation because the ‘compress-documentation’
> phase takes care of that, and passes the ‘-n’ flag, which is important
> for bitwise reproducibility.

Makes sense, we wouldn't want timestamps. My mistake.

>
> Also, you can remove the ‘mkdir-p’ call and replace the ‘copy-file’ call
> with:
>
>   (install-file "z.1" man)
>
> Last: please remove ‘-path’ from variable names—in GNU the convention is
> touse the term “path” only for search paths ($PATH, etc.)

Thanks for pointing this out. After going to review some uses of the
`install-file` function, I see this is certainly the case.

>
>> +    (synopsis "Jump about directories")
>> +    (description
>> +     "Tracks your most used directories, based on freecency.  After a short
>> +learning phase, z will take you to the most frecent directory that matches
>> +ALL of the regexes given on the command line in order.")
>
> It’s suggest writing “``frecency''” (with quotes) to make it clear that
> it’s not a typo.  :-)

Agree.

>
> Could you send an updated patch?
>
> Thanks,
> Ludo’.

You will find an updated patch as part of this email with the above
changes.

Kind regards, and thanks for the helpful feedback.
[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Add-sh-z-shell-tool.patch (text/x-patch, attachment)]
[Message part 4 (text/plain, inline)]
-- 
Collin J. Doering

http://rekahsoft.ca
http://blog.rekahsoft.ca
http://git.rekahsoft.ca

Information forwarded to guix-patches <at> gnu.org:
bug#37364; Package guix-patches. (Fri, 13 Sep 2019 08:50:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "Collin J. Doering" <collin <at> rekahsoft.ca>
Cc: 37364 <at> debbugs.gnu.org
Subject: Re: [bug#37364] [PATCH 1/1] gnu: Add z for zsh
Date: Fri, 13 Sep 2019 10:47:45 +0200
[Message part 1 (text/plain, inline)]
Hello,

"Collin J. Doering" <collin <at> rekahsoft.ca> skribis:

> From f5fd56da740cd2576def4c01c3cc7003f1c9f2d7 Mon Sep 17 00:00:00 2001
> From: "Collin J. Doering" <collin <at> rekahsoft.ca>
> Date: Wed, 11 Sep 2019 23:08:37 -0400
> Subject: [PATCH] gnu: Add sh-z shell tool
>
> * gnu/packages/shellutils.scm (sh-z): New variable.
>
> Signed-off-by: Collin J. Doering <collin <at> rekahsoft.ca>

Applied with the tiny changes below.

Note: We reserve ‘Signed-off-by’ for those who commit on your behalf, so
you don’t need to provide it.

Thank you,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index bbdfd0dadd..f901eaaa8f 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -34,7 +34,6 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages compression)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
@@ -67,12 +66,13 @@
                     (bin (string-append out "/bin")))
                (install-file "z.sh" bin)
                (chmod (string-append bin "/z.sh") #o755)
-               (install-file "z.1" man)))))))
+               (install-file "z.1" man)
+               #t))))))
     (synopsis "Jump about directories")
     (description
      "Tracks your most used directories, based on ``frecency''.  After a short
 learning phase, z will take you to the most ``frecent'' directory that matches
-ALL of the regexes given on the command line in order.")
+all of the regexes given on the command line in order.")
     (home-page "https://github.com/rupa/z")
     (license license:expat)))
 

Added tag(s) fixed. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 13 Sep 2019 08:50:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 37364 <at> debbugs.gnu.org and "Collin J. Doering" <collin <at> rekahsoft.ca> Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 13 Sep 2019 08:50:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 Oct 2019 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 199 days ago.

Previous Next


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