guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: postgresql: Substitute hard coded "/bin/sh".


From: Ricardo Wurmus
Subject: Re: [PATCH] gnu: postgresql: Substitute hard coded "/bin/sh".
Date: Thu, 24 Mar 2016 22:24:32 +0100
User-agent: mu4e 0.9.13; emacs 24.5.1

Hi John,

thanks for the patch!  While the patch looks generally okay, I do want
to make a few nit-picking comments.

> * gnu/packages/databses.scm (postgresql): substitute /bin/sh
> with location of  bash binary.
                  ^
                   \_ why two spaces?

>      (build-system gnu-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-before
> +          'configure 'patch-/bin/sh

we usually keep these on the same line as “add-before”.

> +          (lambda* (#:key inputs #:allow-other-keys)
> +            (let ((bash (assoc-ref inputs "bash")))
> +              ;; Refer to the actual shell.
> +              (substitute* '("src/bin/pg_ctl/pg_ctl.c"
> +                             "src/bin/psql/command.c")
> +                (("/bin/sh")
> +                 (string-append bash "/bin/sh")))))))))

I think we could just do this:

    (lambda _
      (substitute* '(...)
        (("/bin/sh") (which "sh")))
      #t)

Also note the final “#t” because “substitute*” has an undetermined
return value.

What do you think?

~~ Ricardo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]