GNU bug report logs -
#49581
[PATCH] Add git-issues
Previous Next
Full log
Message #23 received at 49581 <at> debbugs.gnu.org (full text, mbox):
Hi again,
Sarah Morgensen <iskarian <at> 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
This bug report was last modified 2 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.