diff options
author | Florian Klink <flokli@flokli.de> | 2017-11-17 13:36:14 +0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2017-11-18 09:37:05 +0100 |
commit | e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd (patch) | |
tree | 7e888e737cffecb7ec5b4abb6304ed1ce72a6fb4 /pkgs/applications/version-management/git-and-tools | |
parent | b8f7027360855faee9d72956092be2e030a12a5f (diff) | |
download | nixlib-e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd.tar nixlib-e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd.tar.gz nixlib-e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd.tar.bz2 nixlib-e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd.tar.lz nixlib-e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd.tar.xz nixlib-e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd.tar.zst nixlib-e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd.zip |
git: honor $PATH for sendmail used in git-send-email command
git-send-email will now search $PATH for a sendmail binary, instead of the (previously fixed) list of paths.
Diffstat (limited to 'pkgs/applications/version-management/git-and-tools')
-rw-r--r-- | pkgs/applications/version-management/git-and-tools/git/default.nix | 1 | ||||
-rw-r--r-- | pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch | 47 |
2 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 5e42992cbe22..c0b672069005 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -32,6 +32,7 @@ stdenv.mkDerivation { ./symlinks-in-bin.patch ./git-sh-i18n.patch ./ssh-path.patch + ./git-send-email-honor-PATH.patch ]; postPatch = '' diff --git a/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch b/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch new file mode 100644 index 000000000000..1aec77504b7b --- /dev/null +++ b/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch @@ -0,0 +1,47 @@ +From 9a4396ddaedaf59ebee16d69900884e990b79cdd Mon Sep 17 00:00:00 2001 +From: Florian Klink <flokli@flokli.de> +Date: Fri, 17 Nov 2017 13:21:37 +0100 +Subject: [PATCH] git-send-email: honor $PATH + +This will search $PATH for a sendmail binary, instead of the (previously +fixed) list of paths. + +Signed-off-by: Florian Klink <flokli@flokli.de> +--- + Documentation/git-send-email.txt | 5 ++--- + git-send-email.perl | 3 ++- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt +index bac9014ac..b9b1f2c41 100644 +--- a/Documentation/git-send-email.txt ++++ b/Documentation/git-send-email.txt +@@ -203,9 +203,8 @@ a password is obtained using 'git-credential'. + specify a full pathname of a sendmail-like program instead; + the program must support the `-i` option. Default value can + be specified by the `sendemail.smtpServer` configuration +- option; the built-in default is `/usr/sbin/sendmail` or +- `/usr/lib/sendmail` if such program is available, or +- `localhost` otherwise. ++ option; the built-in default is to search in $PATH if such program is ++ available, or `localhost` otherwise. + + --smtp-server-port=<port>:: + Specifies a port different from the default port (SMTP +diff --git a/git-send-email.perl b/git-send-email.perl +index 2208dcc21..8e357aeab 100755 +--- a/git-send-email.perl ++++ b/git-send-email.perl +@@ -885,7 +885,8 @@ if (defined $initial_reply_to) { + } + + if (!defined $smtp_server) { +- foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) { ++ my @sendmail_paths = map {"$_/sendmail"} split /:/, $ENV{PATH}; ++ foreach (@sendmail_paths) { + if (-x $_) { + $smtp_server = $_; + last; +-- +2.15.0 + |