all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sarah Morgensen <iskarian@mgsn.dev>
To: phodina <phodina@protonmail.com>
Cc: Tobias Geerinckx-Rice <me@tobias.gr>, 49581@debbugs.gnu.org
Subject: [bug#49581] [PATCH v3] gnu: Add git-issues.
Date: Thu, 23 Sep 2021 00:15:50 -0700	[thread overview]
Message-ID: <86ilyrwymx.fsf@mgsn.dev> (raw)
In-Reply-To: <86v92sw942.fsf@mgsn.dev> (Sarah Morgensen's message of "Wed, 22 Sep 2021 15:14:53 -0700 (7 hours, 33 minutes, 32 seconds ago)")

Hi again,

Sarah Morgensen <iskarian@mgsn.dev> writes:

> Additionally, it looks like git-issue depends on several tools: cat,
> curl, grep, git, find, jq, and sed, at least.  These should probably be
> included in inputs and substituted in the script, perhaps with:
>
> (add-before 'install 'patch-paths
>   (lambda* (#:key inputs #:allow-other-keys)
>     (define (input-file input file)
>       (string-append (assoc-ref inputs input) "/" file))
>
>     (substitute* '("git-issue.sh"
>                    "lib/git-issue/import-export.sh"
>                    "scripts/replacerefs.sh")
>       (("\\bcat\\b") (input-file "coreutils" "bin/cat"))
>       (("\\bcurl\\b") (input-file "curl" "bin/curl"))
>       (("\\bdate\\b") (input-file "coreutils" "bin/date"))
>       (("\\bgit\\b") (input-file "git-minimal" "bin/git"))
>       (("\\bgrep\\b") (input-file "grep" "bin/grep"))
>       (("\\bfind\\b") (input-file "findutils" "bin/find"))
>       (("\\bjq\\b") (input-file "jq" "bin/jq"))
>       (("\\bsed\\b") (input-file "sed" "bin/sed"))
>       ;; Substitute back any usage examples.
>       (("((usage|Example): )/gnu/store/[^/]+/bin/(\\w+)"
>         all start exec)
>        (string-append start exec)))))
>
> I may have missed a few utilities, though.

I belatedly realized you could also use 'wrap-program', which is
probably less error-prone.  For example (untested, and not very pretty):

--8<---------------cut here---------------start------------->8---
(let ((out (assoc-ref outputs "out"))
      (paths (map
              (lambda (input)
                (string-append (assoc-ref inputs input) "/bin"))
              '("coreutils" "curl" "findutils"
                "git-minimal" "grep" "jq" "sed")))
  (for-each
    (lambda (program)
      (wrap-program
       (string-append out "/" program)
       `("PATH" prefix ,paths)))
    '("bin/git-issue" "lib/git-issue/import-export.sh"))))
--8<---------------cut here---------------end--------------->8---

Thinking about it, I'm not sure if the bash autocompletion script
("etc/bash_completion.d/git-issue") should be wrapped as well.

Hope that helps,
--
Sarah




  reply	other threads:[~2021-09-23  7:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 17:01 [bug#49581] [PATCH] Add git-issues phodina via Guix-patches via
2021-07-17  9:39 ` Giovanni Biscuolo
2021-07-17 10:23 ` Tobias Geerinckx-Rice via Guix-patches via
2021-07-17 12:25   ` phodina via Guix-patches via
2021-09-18  8:31 ` [bug#49581] [PATCH v3] gnu: " phodina via Guix-patches via
2021-09-22 22:14   ` Sarah Morgensen
2021-09-23  7:15     ` Sarah Morgensen [this message]
2021-11-01 20:21 ` [bug#49581] [PATCH v4] " phodina via Guix-patches via
2022-11-22 17:38   ` Giovanni Biscuolo
2023-05-29 14:35 ` [bug#49581] [PATCH v5] gnu: Add git-issue jlicht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ilyrwymx.fsf@mgsn.dev \
    --to=iskarian@mgsn.dev \
    --cc=49581@debbugs.gnu.org \
    --cc=me@tobias.gr \
    --cc=phodina@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.