aboutsummaryrefslogtreecommitdiffstats
path: root/make-version.pl
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-11-15 07:12:19 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-11-15 07:12:19 +0000
commitf8467706acb1140ad4889ef76ddc0f4743b8e667 (patch)
tree37ce01c252b3d0159dfe501eed0f39d3b7f967bb /make-version.pl
parente600a12538b26bceae600fddc071548621584cd9 (diff)
From Michael Mann:
Make it possible to use TortoiseSVN's SubWCRev.exe to update svnversion.h https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5441 svn path=/trunk/; revision=39842
Diffstat (limited to 'make-version.pl')
-rwxr-xr-xmake-version.pl19
1 files changed, 18 insertions, 1 deletions
diff --git a/make-version.pl b/make-version.pl
index 38c84c1859..1eab7941b5 100755
--- a/make-version.pl
+++ b/make-version.pl
@@ -67,6 +67,7 @@ use Getopt::Long;
my $version_file = 'svnversion.h';
my $package_string = "";
my $vconf_file = 'version.conf';
+my $tortoise_file = "tortoise_template";
my $last_change = 0;
my $revision = 0;
my $repo_path = "unknown";
@@ -74,6 +75,7 @@ my $pkg_version = 0;
my %version_pref = (
"enable" => 1,
"svn_client" => 1,
+ "tortoise_svn" => 0,
"format" => "SVN %Y%m%d%H%M%S",
"is_release" => 0,
@@ -132,6 +134,21 @@ sub read_svn_info {
if ($last_change && $revision && $repo_url && $repo_root) {
$do_hack = 0;
}
+ } elsif ($version_pref{"tortoise_svn"}) {
+ #dynamically generic template file needed by TortoiseSVN
+ open(TORTOISE, ">$tortoise_file");
+ print TORTOISE "#define SVNVERSION \"\$WCREV\$\"\r\n";
+ print TORTOISE "#define SVNPATH \"\$WCURL\$\"\r\n";
+ close(TORTOISE);
+
+ $svn_info_cmd = "SubWCRev $srcdir $tortoise_file $version_file";
+ my $tortoise = system($svn_info_cmd);
+ if ($tortoise == 0) {
+ $do_hack = 0;
+ }
+
+ #clean up the template file
+ unlink($tortoise_file);
}
# 'svn info' failed or the user really wants us to dig around in .svn/entries
@@ -254,7 +271,7 @@ sub print_svn_version
my $svn_version;
my $needs_update = 1;
- if ($pkg_version || $version_pref{"is_release"} == 1) { return; }
+ if ($pkg_version || $version_pref{"is_release"} == 1 || $version_pref{"tortoise_svn"}) { return; }
if ($last_change && $revision) {
$svn_version = "#define SVNVERSION \"SVN Rev " .