summaryrefslogtreecommitdiff
path: root/make-version.pl
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-10-14 19:13:08 +0200
committerGerald Combs <gerald@wireshark.org>2015-10-19 18:59:07 +0000
commit1868dce4dee2ccfbb5ab3a60f88c192508b8ea13 (patch)
treee25e516192b3b120a1a2a033e555392403fb8853 /make-version.pl
parent2bde91330a19c7d7f848c147c7f9c5e8681018b7 (diff)
downloadwireshark-1868dce4dee2ccfbb5ab3a60f88c192508b8ea13.tar.gz
make-version.pl: no need for git-ls-remote
In subversion, the URL was needed to find the branch. This is not needed for git where a 'git branch' command suffices. Remove the unused URL handling from git, this fixes a warning during cmake on RHEL6 and avoids a fallback to SVN: Version configuration file version.conf not found. Using defaults. usage: git ls-remote [--heads] [--tags] [-u <exec> | --upload-pack <exec>] <repository> <refs>... Unable to open ./.svn/entries #define VCSVERSION "v2.1.0rc0-69-g2eb7e87" #define VCSBRANCH "master" Print the SVN warning to stderr, this avoids a compilation failure due to a syntax error in version.h. Change-Id: Idb28e74b7a9bf592686b45349cf5e81f85f6c358 Reviewed-on: https://code.wireshark.org/review/11041 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'make-version.pl')
-rwxr-xr-xmake-version.pl21
1 files changed, 8 insertions, 13 deletions
diff --git a/make-version.pl b/make-version.pl
index bbb580be63..0eee0beaba 100755
--- a/make-version.pl
+++ b/make-version.pl
@@ -116,8 +116,6 @@ sub read_repo_info {
my $in_entries = 0;
my $svn_name;
my $repo_version;
- my $repo_root = undef;
- my $repo_url = undef;
my $do_hack = 1;
my $info_source = "Unknown";
@@ -179,11 +177,6 @@ sub read_repo_info {
$commit_id = $parts[-1];
}
- chomp($line = qx{git --git-dir=$srcdir/.git ls-remote --get-url origin});
- if (defined($line)) {
- $repo_url = $line;
- }
-
# This will break in some cases. Hopefully not during
# official package builds.
chomp($line = qx{git --git-dir=$srcdir/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\}});
@@ -194,10 +187,12 @@ sub read_repo_info {
1;
};
- if ($last_change && $num_commits && $repo_url && $repo_branch) {
+ if ($last_change && $num_commits && $repo_branch) {
$do_hack = 0;
}
} elsif ($version_pref{"svn_client"}) {
+ my $repo_root = undef;
+ my $repo_url = undef;
eval {
use warnings "all";
no warnings "all";
@@ -220,6 +215,10 @@ sub read_repo_info {
1;
};
+ if ($repo_url && $repo_root && index($repo_url, $repo_root) == 0) {
+ $repo_branch = substr($repo_url, length($repo_root));
+ }
+
if ($last_change && $num_commits && $repo_url && $repo_root) {
$do_hack = 0;
}
@@ -316,7 +315,7 @@ sub read_repo_info {
if ($do_hack) {
# Start of ugly internal SVN file hack
if (! open (ENTRIES, "< $srcdir/.svn/entries")) {
- print ("Unable to open $srcdir/.svn/entries\n");
+ print STDERR "Unable to open $srcdir/.svn/entries\n";
} else {
$info_source = "Prodding .svn";
# We need to find out whether our parser can handle the entries file
@@ -366,10 +365,6 @@ sub read_repo_info {
$package_string = strftime($package_format, gmtime($last_change));
}
- if ($repo_url && $repo_root && index($repo_url, $repo_root) == 0) {
- $repo_branch = substr($repo_url, length($repo_root));
- }
-
if ($get_vcs) {
print <<"Fin";
Commit distance : $num_commits