* [PATCH 1/2] gnu: postgresql: Substitute hard coded "/bin/sh".
@ 2016-03-24 17:54 John Darrington
2016-03-24 18:18 ` Thompson, David
0 siblings, 1 reply; 5+ messages in thread
From: John Darrington @ 2016-03-24 17:54 UTC (permalink / raw)
To: guix-devel; +Cc: John Darrington
* gnu/packages/databses.scm (postgresql): substitute /bin/sh
with location of bash binary.
---
gnu/packages/databases.scm | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 25c1e6a..ff68d6f 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -283,6 +283,17 @@ as a drop-in replacement of MySQL.")
(base32
"08ba951nfiy516flaw352shj1zslxg4ryx3w5k0adls1r682l8ix"))))
(build-system gnu-build-system)
+ (arguments
+ '(#:phases (alist-cons-before
+ 'configure 'patch-/bin/sh
+ (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")))))
+ %standard-phases)))
(inputs
`(("readline" ,readline)
("zlib" ,zlib)))
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] gnu: postgresql: Substitute hard coded "/bin/sh".
2016-03-24 17:54 [PATCH 1/2] gnu: postgresql: Substitute hard coded "/bin/sh" John Darrington
@ 2016-03-24 18:18 ` Thompson, David
2016-03-24 21:12 ` [PATCH] " John Darrington
0 siblings, 1 reply; 5+ messages in thread
From: Thompson, David @ 2016-03-24 18:18 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
On Thu, Mar 24, 2016 at 1:54 PM, John Darrington <jmd@gnu.org> wrote:
> * gnu/packages/databses.scm (postgresql): substitute /bin/sh
> with location of bash binary.
Good catch!
> ---
> gnu/packages/databases.scm | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
> index 25c1e6a..ff68d6f 100644
> --- a/gnu/packages/databases.scm
> +++ b/gnu/packages/databases.scm
> @@ -283,6 +283,17 @@ as a drop-in replacement of MySQL.")
> (base32
> "08ba951nfiy516flaw352shj1zslxg4ryx3w5k0adls1r682l8ix"))))
> (build-system gnu-build-system)
> + (arguments
> + '(#:phases (alist-cons-before
> + 'configure 'patch-/bin/sh
> + (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")))))
> + %standard-phases)))
Please use the 'modify-phases' syntax instead. Search
gnu/packages/*.scm for many examples of its use.
> (inputs
> `(("readline" ,readline)
> ("zlib" ,zlib)))
> --
> 2.1.4
>
>
Could you send an updated patch? Thanks!
- Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] gnu: postgresql: Substitute hard coded "/bin/sh".
2016-03-24 18:18 ` Thompson, David
@ 2016-03-24 21:12 ` John Darrington
2016-03-24 21:24 ` Ricardo Wurmus
0 siblings, 1 reply; 5+ messages in thread
From: John Darrington @ 2016-03-24 21:12 UTC (permalink / raw)
To: guix-devel; +Cc: John Darrington
* gnu/packages/databses.scm (postgresql): substitute /bin/sh
with location of bash binary.
---
gnu/packages/databases.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 25c1e6a..b67481f 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -283,6 +283,18 @@ as a drop-in replacement of MySQL.")
(base32
"08ba951nfiy516flaw352shj1zslxg4ryx3w5k0adls1r682l8ix"))))
(build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before
+ 'configure 'patch-/bin/sh
+ (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")))))))))
(inputs
`(("readline" ,readline)
("zlib" ,zlib)))
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gnu: postgresql: Substitute hard coded "/bin/sh".
2016-03-24 21:12 ` [PATCH] " John Darrington
@ 2016-03-24 21:24 ` Ricardo Wurmus
2016-03-25 7:29 ` John Darrington
0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2016-03-24 21:24 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gnu: postgresql: Substitute hard coded "/bin/sh".
2016-03-24 21:24 ` Ricardo Wurmus
@ 2016-03-25 7:29 ` John Darrington
0 siblings, 0 replies; 5+ messages in thread
From: John Darrington @ 2016-03-25 7:29 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel, John Darrington
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
I committed it with the changes you suggested.
Thanks
On Thu, Mar 24, 2016 at 10:24:32PM +0100, Ricardo Wurmus wrote:
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
--
Avoid eavesdropping. Send strong encryted email.
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-25 7:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 17:54 [PATCH 1/2] gnu: postgresql: Substitute hard coded "/bin/sh" John Darrington
2016-03-24 18:18 ` Thompson, David
2016-03-24 21:12 ` [PATCH] " John Darrington
2016-03-24 21:24 ` Ricardo Wurmus
2016-03-25 7:29 ` John Darrington
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).