ghostscript shell scripts refer to unqualified external commands

  • Open
  • quality assurance status badge
Details
2 participants
  • Jack Hill
  • zimoun
Owner
unassigned
Submitted by
Jack Hill
Severity
normal
J
J
Jack Hill wrote on 16 Sep 2021 17:28
(address . bug-guix@gnu.org)
alpine.DEB.2.21.2109161121570.4243@marsh.hcoop.net
Hi Guix,

Many of the commands, e.g. ps2pdf, provided by the ghostscript package are
implemented as shell scripts that do some argument or file name processing
before invoking the main gs binary. These scripts invoke external commands
like basename, awk, dirname, and even gs by dynamically looking them up
PATH. Instead, they should refer to a specific path in the store so that
the behavior of ghostscript doesn't depend on the environment and so that
Guix can see these references.

Best,
Jack
Z
Z
zimoun wrote on 17 Sep 2021 16:44
(name . Jack Hill)(address . jackhill@jackhill.us)(address . 50625@debbugs.gnu.org)
CAJ3okZ387X0bWitCQfbWAMDmdBBtET7gduiqK+y8FqjeEs60LQ@mail.gmail.com
Hi,

On Thu, 16 Sept 2021 at 17:29, Jack Hill <jackhill@jackhill.us> wrote:

Toggle quote (8 lines)
> Many of the commands, e.g. ps2pdf, provided by the ghostscript package are
> implemented as shell scripts that do some argument or file name processing
> before invoking the main gs binary. These scripts invoke external commands
> like basename, awk, dirname, and even gs by dynamically looking them up
> PATH. Instead, they should refer to a specific path in the store so that
> the behavior of ghostscript doesn't depend on the environment and so that
> Guix can see these references.

Indeed.

Toggle snippet (13 lines)
$ guix environment -C --ad-hoc ghostscript
[env]$ ps2pdf --version
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdf: line
8: dirname: command not found
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdf14: line
3: dirname: command not found
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdfwr: line
7: dirname: command not found
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdfwr: line
24: basename: command not found
Usage: [options...] (input.[e]ps|-) [output.pdf|-]

The fix would to add these external commands as 'inputs' and then let
'wrap-program'. Do you want to give a try?

Cheers,
simon
?