aboutsummaryrefslogtreecommitdiffstats
path: root/make-version.pl
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2007-01-19 06:34:07 +0000
committerGerald Combs <gerald@wireshark.org>2007-01-19 06:34:07 +0000
commit0bd2bdb7a3b26ee750bfb529cb69b2b20fd9c848 (patch)
tree4ea89ef5b071bf8549eac9a1de400c9bd5f9b8f8 /make-version.pl
parentdd54b08edaac0cbf9b9e0170c5189f3e956afc4d (diff)
Set our package version even if we're using the SVN client.
svn path=/trunk/; revision=20500
Diffstat (limited to 'make-version.pl')
-rwxr-xr-xmake-version.pl57
1 files changed, 31 insertions, 26 deletions
diff --git a/make-version.pl b/make-version.pl
index dc2a7d9ffa..ea5cc41907 100755
--- a/make-version.pl
+++ b/make-version.pl
@@ -114,37 +114,42 @@ sub read_svn_info {
if ($line =~ /Last Changed Date: (\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/) {
$last = timegm($6, $5, $4, $3, $2 - 1, $1);
}
- if ($line =~ /Last Changed Rev: (\d+)/) { $revision = $1; }
- return;
- }
-
- # The entries schema is flat, so we can use regexes to parse its contents.
- while ($line = <ENTRIES>) {
- if ($line =~ /<entry$/ || $line =~ /<entry\s/) {
- $in_entries = 1;
- $svn_name = "";
+ if ($line =~ /Last Changed Rev: (\d+)/) {
+ $revision = $1;
}
- if ($in_entries) {
- if ($line =~ /name="(.*)"/) { $svn_name = $1; }
- if ($line =~ /committed-date="(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)/) {
- $last = timegm($6, $5, $4, $3, $2 - 1, $1);
+ } else {
+ # The entries schema is flat, so we can use regexes to parse its contents.
+ while ($line = <ENTRIES>) {
+ if ($line =~ /<entry$/ || $line =~ /<entry\s/) {
+ $in_entries = 1;
+ $svn_name = "";
}
- if ($line =~ /revision="(\d+)"/) { $revision = $1; }
- }
- if ($line =~ /\/>/) {
- if (($svn_name eq "" || $svn_name eq "svn:this_dir") &&
- $last && $revision) {
- $in_entries = 0;
- $version_format =~ s/%#/$revision/;
-
- $package_format =~ s/%#/$revision/;
- $package_string = strftime($package_format, gmtime($last));
-
- last;
+ if ($in_entries) {
+ if ($line =~ /name="(.*)"/) { $svn_name = $1; }
+ if ($line =~ /committed-date="(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)/) {
+ $last = timegm($6, $5, $4, $3, $2 - 1, $1);
+ }
+ if ($line =~ /revision="(\d+)"/) { $revision = $1; }
+ }
+ if ($line =~ /\/>/) {
+ if (($svn_name eq "" || $svn_name eq "svn:this_dir") &&
+ $last && $revision) {
+ $in_entries = 0;
+ last;
+ }
}
}
+ close ENTRIES;
+ }
+
+ # If we picked up the revision and modification time,
+ # generate our strings.
+ if ($revision && $last) {
+ $version_format =~ s/%#/$revision/;
+ $package_format =~ s/%#/$revision/;
+ $package_string = strftime($package_format, gmtime($last));
}
- close ENTRIES;
+
}