aboutsummaryrefslogtreecommitdiffstats
path: root/make-version.pl
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2012-09-15 16:09:07 +0000
committerEvan Huus <eapache@gmail.com>2012-09-15 16:09:07 +0000
commit37f0380998229e6aae36656269cad040516b126b (patch)
treef3ba240a5ede2380955281b6365e3ce2e304994a /make-version.pl
parent201c4c45bf0bbc34cff22de81756654333fbdd1e (diff)
Add support for bzr checkouts (similar to git checkouts) to make-version.pl.
Also, add modelines. svn path=/trunk/; revision=44920
Diffstat (limited to 'make-version.pl')
-rwxr-xr-xmake-version.pl36
1 files changed, 35 insertions, 1 deletions
diff --git a/make-version.pl b/make-version.pl
index fae429613c..86f7895eab 100755
--- a/make-version.pl
+++ b/make-version.pl
@@ -182,7 +182,7 @@ sub read_svn_info {
}
close (CFGNMAKE);
}
- if ($revision == 0) {
+ if ($revision == 0 and -d "$srcdir/.git") {
# Try git...
eval {
@@ -208,6 +208,26 @@ sub read_svn_info {
1;
};
}
+ if ($revision == 0 and -d "$srcdir/.bzr") {
+
+ # Try bzr...
+ eval {
+ use warnings "all";
+ no warnings "all";
+ $svn_info_cmd = "(cd $srcdir; bzr log -l 1)";
+ $line = qx{$svn_info_cmd};
+ if (defined($line)) {
+ if ($line =~ /timestamp: \S+ (\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/) {
+ $last_change = timegm($6, $5, $4, $3, $2 - 1, $1);
+ }
+ if ($line =~ /svn revno: (\d+) \(on (\S+)\)/) {
+ $revision = $1;
+ $repo_path = $2;
+ }
+ }
+ 1;
+ };
+ }
# 'svn info' failed or the user really wants us to dig around in .svn/entries
@@ -610,3 +630,17 @@ make-version.pl [options] [source directory]
Options can be used in any combination. If none are specified B<--set-svn>
is assumed.
+
+#
+# Editor modelines - http://www.wireshark.org/tools/modelines.html
+#
+# Local variables:
+# c-basic-offset: 8
+# tab-width: 8
+# indent-tabs-mode: t
+# End:
+#
+# vi: set shiftwidth=8 tabstop=8 noexpandtab:
+# :indentSize=8:tabSize=8:noTabs=false:
+#
+#