Subject: bug#26770: [PATCH] gnu: tailon: Use absolute paths for commands.

From: Marius Bakke <[email-masked]>
Date: Mon, 15 May 2017 17:59:42 +0200

Christopher Baines <[email-masked]> writes:

> * gnu/packages/logging.scm (tailon)[arguments]: Patch commands.py to reference
>   grep, awk, sed and tail by absolute paths.

Thanks for this!

[...]

> +         (add-after 'install 'wrap-tailon-path
> +                    (lambda* (#:key inputs outputs #:allow-other-keys)
> +                      (let ((out (assoc-ref outputs "out")))
> +                        (substitute* (find-files out "commands.py")
> +                          (("self\\.first_in_path\\('grep'\\)")
> +                           (string-append"'" (which "grep") "'"))
> +                          (("self\\.first_in_path\\('gawk', 'awk'\\)")
> +                           (string-append"'" (which "gawk") "'"))
> +                          (("self\\.first_in_path\\('gsed', 'sed'\\)")
> +                           (string-append"'" (which "sed") "'"))
> +                          (("self\\.first_in_path\\('gtail', 'tail'\\)")
> +                           (string-append"'" (which "tail") "'")))
> +                        #t))))))

Is there any particular reason this phase runs after 'install'? I think
we should try to avoid modifying files after they have been copied to
the store, but if doing this substitution earlier is difficult I guess
it's okay with a comment.