From 062afde1f7aa335f3be5e1074187a6dd0d33614b Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 17 Mar 2020 08:37:32 +0100 Subject: [PATCH] gnu: postfix-minimal: Fix startup warnings. This avoids kind of funny replacements like these of `rm' find -prune -perm -020 => find -prune -pe/gnu/store/zibwkb5xavnv6z3gzknfqjsxb9b0izh0-coreutils-8.31/bin/rm -020 * gnu/packages/mail.scm (postfix-minimal)[phases]: Set PATH rather than substituting individual commands. --- gnu/packages/mail.scm | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 2cf1640200..287da82d55 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -30,6 +30,7 @@ ;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus ;;; Copyright © 2019 Tanguy Le Carrour ;;; Copyright © 2020 Brant Gardner +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -3145,7 +3146,10 @@ Atom feeds or HTML archives.") "0hw9kbr05qdzvfqhxi4dp4n3s9xvdh0gr0la08a4bip06ybl4pcd")))) (build-system gnu-build-system) (arguments - '(#:phases + '(#:modules ((srfi srfi-26) + (guix build utils) + (guix build gnu-build-system)) + #:phases (modify-phases %standard-phases (add-before 'build 'patch-/bin/sh (lambda _ @@ -3177,14 +3181,20 @@ Atom feeds or HTML archives.") (lambda _ (invoke "make" "makefiles" "pie=yes" "dynamicmaps=yes"))) (add-before 'install 'fix-postfix-scripts-path - (lambda _ - (for-each - (lambda (command) - (substitute* '("postfix-install" "conf/post-install" "conf/postfix-script") - (((string-append command " ")) (string-append (which command) " ")))) - '("awk" "chmod" "chown" "chgrp" "cp" "find" "ln" "mkdir" "mv" "rm" "sed" - "sleep" "sort" "touch" "uname")) - #t)) + (lambda* (#:key inputs #:allow-other-keys) + (let ((path (string-join + (map (compose (cute string-append <> "/bin") + (cute assoc-ref inputs <>)) + '("bash" "coreutils" "findutils" "gawk" "grep" + "sed")) + ":"))) + (substitute* '("postfix-install" + "conf/post-install" + "conf/postfix-script") + (("^SHELL=/bin/sh") + (string-append "PATH=" path "\n" + "SHELL=" (assoc-ref inputs "bash") "/bin/sh"))) + #t))) (add-before 'install 'configure-install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) -- 2.24.0