diff options
author | Gerald Combs <gerald@wireshark.org> | 2014-04-14 09:53:47 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2014-04-14 17:15:01 +0000 |
commit | dacc7eea39ec560bf5c8edf0e850d1798c678b67 (patch) | |
tree | 5bc87134b2b24dbf8d06a50bcd23420b33380cdf /make-version.pl | |
parent | e9e4277f2a8e22d68d5280b82372313fbe5ad568 (diff) |
Pull in some changes from master-1.10/make-version.pl.
Matches versioning behavior in stable branches.
Change-Id: Ic4d451e7e9941b65d24a76bfaf57de2b4fb58239
Reviewed-on: https://code.wireshark.org/review/1124
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'make-version.pl')
-rwxr-xr-x | make-version.pl | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/make-version.pl b/make-version.pl index b7ade45097..b42d1ccd6a 100755 --- a/make-version.pl +++ b/make-version.pl @@ -116,7 +116,7 @@ sub read_repo_info { my $do_hack = 1; my $info_source = "Unknown"; - if ($version_pref{"pkg_enable"}) { + if ($version_pref{"pkg_enable"} > 0) { $package_format = $version_pref{"pkg_format"}; } @@ -139,8 +139,8 @@ sub read_repo_info { # A small ugly hash: git rev-parse --short HEAD # 1ddc838 # - # The upstream branch path: git rev-parse --abbrev-ref --symbolic-full-name origin - # origin/master-1.8 + # The upstream branch path: git rev-parse --abbrev-ref --symbolic-full-name @{upstream} + # origin/master # # A version description: git describe --tags --dirty # wireshark-1.8.12-15-g1ddc838 @@ -165,34 +165,26 @@ sub read_repo_info { } # Commits since last annotated tag. - chomp($line = qx{git --git-dir=$srcdir/.git describe --long --always}); + chomp($line = qx{git --git-dir=$srcdir/.git describe --long --always --match "v*"}); if ($? == 0 && length($line) > 1) { my @parts = split(/-/, $line); + $git_description = $line; $num_commits = $parts[-2]; $commit_id = $parts[-1]; } - # Current short hash prefixed with "g" - chomp($line = qx{git --git-dir=$srcdir/.git rev-parse --short HEAD}); - if ($? == 0 && length($line) > 1) { - } - - chomp($line = qx{git --git-dir=$srcdir/.git ls-remote --get-url origin}); - if ($? == 0 && length($line) > 1) { + chomp($line = qx{git ls-remote --get-url origin}); + if (defined($line)) { $repo_url = $line; } - # Probably not quite what we're looking for - chomp($line = qx{git --git-dir=$srcdir/.git rev-parse --abbrev-ref --symbolic-full-name origin}); + # 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\}}); if ($? == 0 && length($line) > 1) { $repo_branch = basename($line); } - chomp($line = qx{git --git-dir=$srcdir/.git describe --dirty --match "v*"}); - if ($? == 0 && length($line) > 1) { - $git_description = "wireshark-" . substr($line, 1); - } - 1; }; @@ -650,7 +642,7 @@ sub get_config { } while (<FILE>) { - chomp; + s/^\s+|\s+$//g; # chomp() may not handle CR next if (/^#/); next unless (/^(\w+)(:|=)\s*(\S.*)/); $version_pref{$1} = $3; |