summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-09-01 15:47:01 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-09-07 09:08:19 +0000
commit942200994caec36bfc19d9cac4a792eb4f308ee1 (patch)
treee27c226bbc6ec59dde6ba0fa7be8a8004b0e61ec /bin
parent045b138f69f49f5b30aadbf74a2d218d315d15c3 (diff)
qt5_tool: Adapt to file structure of "Git for Windows version 2.5".
Add newly introduced directory 'usr/bin' to the search path and always perform search in order to account for all installation options (bin/cmd). Change-Id: I23cd835d3d574aacd9c641ddf7f7ec5aae927983 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/qt5_tool16
1 files changed, 7 insertions, 9 deletions
diff --git a/bin/qt5_tool b/bin/qt5_tool
index 205aac5..26b4123 100755
--- a/bin/qt5_tool
+++ b/bin/qt5_tool
@@ -127,18 +127,16 @@ sub which
return undef;
}
-# -- Locate an utility (grep, scp, etc) in MSYS git. This is specifically
-# for the setup case in which only git from the cmd folder and not the utilities
-# are in the path. We then look at the git and return ..\bin\<utility>.exe.
+# -- Locate an utility (grep, scp, etc) in MSYS git by
+# cd'ing up from the path of git passed in (either 'cmd/git.exe' or
+# 'bin/git.exe') and then trying 'bin' (pre 2.5) or '/usr/bin' (2.5).
sub msysGitUtility
{
-# -- Look for 'cmd/git(.exe,.cmd)' and cd ..\bin. Note that as of msygit 1.8, git.exe
-# is in cmd.
my ($git, $utility) = @_;
- my $gitBinDir = dirname($git);
- if ($gitBinDir =~ /cmd$/i) {
- my $msysGitBinFolder = File::Spec->catfile(dirname($gitBinDir), 'bin');
- return File::Spec->catfile($msysGitBinFolder, $utility . '.exe');
+ my $msysGitRoot = dirname(dirname($git));
+ foreach my $binFolder ('bin', 'usr/bin') {
+ my $file = File::Spec->catfile($msysGitRoot, $binFolder, $utility . '.exe');
+ return $file if -f $file;
}
return $utility;
}