CMake: remove GIT_BIN_PARAM
authorJoakim Karlsson <oakimk@gmail.com>
Wed, 23 May 2018 21:50:41 +0000 (23:50 +0200)
committerAnders Broman <a.broman58@gmail.com>
Thu, 24 May 2018 04:15:00 +0000 (04:15 +0000)
Added in adb731c1cd69855b1655a0f23001655392a07340 but never worked,
and later corrected in e21da738262af2ba6cf72f46fdc045f0337ca27e.
Correction however gave cygwin user problems with the perl optional parameter
which droped qoutes around the path. But since the orginal commit never worked
as intended in the beginning, it's assume safe to remove.

Change-Id: I825a4e53b257d47601c330b210ac5ffb6870e0d9
Reviewed-on: https://code.wireshark.org/review/27758
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
CMakeLists.txt
make-version.pl

index 3df0b5aa73b0abf513ded80856c6679aea3f429b..a95ff3302c79b6fb56f1b0b01f0b1bc4a0d87bf6 100644 (file)
@@ -1358,15 +1358,11 @@ endif()
 include(gmxTestLargeFiles)
 gmx_test_large_files(GMX_LARGEFILES)
 
-if (GIT_EXECUTABLE)
-       set(GIT_BIN_PARAM --git-bin ${GIT_EXECUTABLE})
-endif()
 set( VERSION ${PROJECT_VERSION} )
 add_custom_target(version
        BYPRODUCTS version.h
        COMMAND ${PERL_EXECUTABLE}
                ${CMAKE_SOURCE_DIR}/make-version.pl
-               --set-vcs ${GIT_BIN_PARAM}
                ${CMAKE_SOURCE_DIR}
 )
 set_target_properties(version PROPERTIES FOLDER "Auxiliary")
@@ -2704,7 +2700,6 @@ if(RPMBUILD_EXECUTABLE)
        execute_process(
                COMMAND ${PERL_EXECUTABLE}
                        ${CMAKE_SOURCE_DIR}/make-version.pl
-                       --set-vcs ${GIT_BIN_PARAM}
                        ${CMAKE_SOURCE_DIR}
        )
 
index a241ec4810189824cef8853f8a7343cf808a6847..dc24716c17330ff9a8b52d1a82a6237f2208e0e9 100755 (executable)
@@ -64,7 +64,6 @@ my $last_change = 0;
 my $num_commits = 0;
 my $commit_id = '';
 my $repo_branch = "unknown";
-my $git_executable = "git";
 my $git_description = undef;
 my $get_vcs = 0;
 my $set_vcs = 0;
@@ -139,13 +138,13 @@ sub read_repo_info {
                $version_pref{"svn_client"} = 1;
        } elsif (-d "$srcdir/.git/svn") {
                $info_source = "Command line (git-svn)";
-               $info_cmd = "(cd $srcdir; $git_executable svn info)";
+               $info_cmd = "(cd $srcdir; git svn info)";
                $is_git_repo = 1;
                $version_pref{"git_svn"} = 1;
        }
 
        # Make sure git is available.
-       if ($is_git_repo && !`$git_executable --version`) {
+       if ($is_git_repo && !`git --version`) {
                print STDERR "Git unavailable. Git revision will be missing from version string.\n";
                return;
        }
@@ -192,13 +191,13 @@ sub read_repo_info {
                        use warnings "all";
                        no warnings "all";
 
-                       chomp($line = qx{$git_executable --git-dir="$srcdir"/.git log -1 --pretty=format:%at});
+                       chomp($line = qx{git --git-dir="$srcdir"/.git log -1 --pretty=format:%at});
                        if ($? == 0 && length($line) > 1) {
                                $last_change = $line;
                        }
 
                        # Commits since last annotated tag.
-                       chomp($line = qx{$git_executable --git-dir="$srcdir"/.git describe --abbrev=8 --long --always --match "v[1-9]*"});
+                       chomp($line = qx{git --git-dir="$srcdir"/.git describe --abbrev=8 --long --always --match "v[1-9]*"});
                        if ($? == 0 && length($line) > 1) {
                                my @parts = split(/-/, $line);
                                $git_description = $line;
@@ -208,7 +207,7 @@ sub read_repo_info {
 
                        # This will break in some cases. Hopefully not during
                        # official package builds.
-                       chomp($line = qx{$git_executable --git-dir="$srcdir"/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\} 2> $devnull});
+                       chomp($line = qx{git --git-dir="$srcdir"/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\} 2> $devnull});
                        if ($? == 0 && length($line) > 1) {
                                $repo_branch = basename($line);
                        }
@@ -279,21 +278,21 @@ sub read_repo_info {
                        # If someone had properly tagged 1.9.0 we could also use
                        # "git describe --abbrev=1 --tags HEAD"
 
-                       $info_cmd = "(cd $srcdir; $git_executable log --format='%b' -n 1)";
+                       $info_cmd = "(cd $srcdir; git log --format='%b' -n 1)";
                        $line = qx{$info_cmd};
                        if (defined($line)) {
                                if ($line =~ /svn path=.*; revision=(\d+)/) {
                                        $num_commits = $1;
                                }
                        }
-                       $info_cmd = "(cd $srcdir; $git_executable log --format='%ad' -n 1 --date=iso)";
+                       $info_cmd = "(cd $srcdir; git log --format='%ad' -n 1 --date=iso)";
                        $line = qx{$info_cmd};
                        if (defined($line)) {
                                if ($line =~ /(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/) {
                                        $last_change = timegm($6, $5, $4, $3, $2 - 1, $1);
                                }
                        }
-                       $info_cmd = "(cd $srcdir; $git_executable branch)";
+                       $info_cmd = "(cd $srcdir; git branch)";
                        $line = qx{$info_cmd};
                        if (defined($line)) {
                                if ($line =~ /\* (\S+)/) {
@@ -627,7 +626,6 @@ sub get_config {
                   "help|h", \$show_help,
                   "get-vcs|get-svn|g", \$get_vcs,
                   "set-vcs|set-svn|s", \$set_vcs,
-                  "git-bin=s" => \$git_executable,
                   "print-vcs", \$print_vcs,
                   "set-version|v", \$set_version,
                   "set-release|r|package-version|p", \$set_release,