From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9345
[metze/wireshark/wip.git] / make-version.pl
index d7e705b7ec40db4b33d4b16baed3211ad99022f0..13f3b7f3097e68af52ebe8285d899c62819f7c59 100755 (executable)
@@ -74,8 +74,8 @@ my $set_version = 0;
 my $set_release = 0;
 my %version_pref = (
        "version_major" => 1,
-       "version_minor" => 9,
-       "version_micro" => 2,
+       "version_minor" => 11,
+       "version_micro" => 1,
        "version_build" => 0,
 
        "enable"        => 1,
@@ -117,7 +117,7 @@ sub read_svn_info {
                $package_format = $version_pref{"pkg_format"};
        }
 
-       if (-d "$srcdir/.svn") {
+       if (-d "$srcdir/.svn" or -d "$srcdir/../.svn") {
                $info_source = "Command line (svn info)";
                $info_cmd = "svn info $srcdir";
        } elsif (-d "$srcdir/.git/svn") {
@@ -367,23 +367,23 @@ sub update_config_nmake
        print "$filepath has been updated.\n";
 }
 
-# Read docbook/release_notes.xml, then write it back out with an updated
-# "WiresharkCurrentVersion" line.
+# Read docbook/asciidoc.conf, then write it back out with an updated
+# wireshark-version replacement line.
 sub update_release_notes
 {
        my $line;
        my $contents = "";
        my $version = "";
-       my $filepath = "$srcdir/docbook/release-notes.xml";
+       my $filepath = "$srcdir/docbook/asciidoc.conf";
 
        return if (!$set_version);
 
-       open(RELNOTES, "< $filepath") || die "Can't read $filepath!";
-       while ($line = <RELNOTES>) {
-               #   <!ENTITY WiresharkCurrentVersion "1.7.1">
+       open(ADOC_CONF, "< $filepath") || die "Can't read $filepath!";
+       while ($line = <ADOC_CONF>) {
+               # wireshark-version:\[\]=1.9.1
 
-               if ($line =~ /<\!ENTITY\s+WiresharkCurrentVersion\s+.*([\r\n]+)$/) {
-                       $line = sprintf("<!ENTITY WiresharkCurrentVersion \"%d.%d.%d\">$1",
+               if ($line =~ /^wireshark-version:\\\[\\\]=.*([\r\n]+)$/) {
+                       $line = sprintf("wireshark-version:\\\[\\\]=%d.%d.%d$1",
                                        $version_pref{"version_major"},
                                        $version_pref{"version_minor"},
                                        $version_pref{"version_micro"},
@@ -392,9 +392,9 @@ sub update_release_notes
                $contents .= $line
        }
 
-       open(RELNOTES, "> $filepath") || die "Can't write $filepath!";
-       print(RELNOTES $contents);
-       close(RELNOTES);
+       open(ADOC_CONF, "> $filepath") || die "Can't write $filepath!";
+       print(ADOC_CONF $contents);
+       close(ADOC_CONF);
        print "$filepath has been updated.\n";
 }
 
@@ -628,7 +628,7 @@ make-version.pl [options] [source directory]
     --set-svn, -s              Set the information in svnversion.h
     --set-version, -v          Set the major, minor, and micro versions in
                                configure.ac, config.nmake, debian/changelog,
-                              and docbook/release_notes.xml.
+                              and docbook/asciidoc.conf.
                                Resets the release information when used by
                               itself.
     --set-release, -r          Set the release information in configure.ac