diff options
author | 2009-05-01 19:03:07 +0000 | |
---|---|---|
committer | 2009-05-01 19:03:07 +0000 | |
commit | 8a19900e7b820534bb8957a9d95680ac4af7f7dd (patch) | |
tree | 40eb9cd8b4caecd8b199d4e9d9e33fc1cba60291 | |
parent | Add GLEP 53 keywords sorting patch from prefix (diff) | |
download | gentoolkit-8a19900e7b820534bb8957a9d95680ac4af7f7dd.tar.gz gentoolkit-8a19900e7b820534bb8957a9d95680ac4af7f7dd.tar.bz2 gentoolkit-8a19900e7b820534bb8957a9d95680ac4af7f7dd.zip |
Respect $PATH while looking for git, thanks to grobian.
svn path=/; revision=570
-rwxr-xr-x | trunk/src/echangelog/echangelog | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/trunk/src/echangelog/echangelog b/trunk/src/echangelog/echangelog index c267c28..f4a0813 100755 --- a/trunk/src/echangelog/echangelog +++ b/trunk/src/echangelog/echangelog @@ -104,10 +104,16 @@ if ( -d "CVS" ) { } elsif ( -d '.svn' ) { $vcs = "svn"; } else { - if ( -x '/usr/bin/git' ) { - open(GIT, '-|', "git rev-parse --git-dir 2>/dev/null"); - $vcs = "git" if defined(<GIT>); - close(GIT); + # Respect $PATH while looking for git + if (getenv("PATH")) { + foreach my $path ( split(":", getenv("PATH")) ) { + if ( -X "$path/git" ) { + open(GIT, '-|', "git rev-parse --git-dir 2>/dev/null"); + $vcs = "git" if defined(<GIT>); + close(GIT); + last; + } + } } if ( ! $vcs ) { |