Maybe it's not a good idea to modify configure.in or config.nmake during
authorGerald Combs <gerald@wireshark.org>
Fri, 18 Nov 2011 01:17:31 +0000 (01:17 -0000)
committerGerald Combs <gerald@wireshark.org>
Fri, 18 Nov 2011 01:17:31 +0000 (01:17 -0000)
compilation. Add a "--set-svn" option which only affects svnversion.h and
make it the default behavior.

svn path=/trunk/; revision=39923

make-version.pl

index 63468733a7115a15f7c6033b35ba2c864280d0ca..1d9d49e5d28b280407455b71b4d07c4d399c0542 100755 (executable)
@@ -69,6 +69,7 @@ my $last_change = 0;
 my $revision = 0;
 my $repo_path = "unknown";
 my $get_svn = 0;
+my $set_svn = 0;
 my $set_version = 0;
 my $set_release = 0;
 my %version_pref = (
@@ -401,7 +402,7 @@ sub print_svn_revision
                close OLDREV;
        }
 
-       if (! $set_version && ! $set_release) { return; }
+       if (! $set_svn) { return; }
 
        if ($needs_update) {
                # print "Updating $version_file so it contains:\n$svn_revision";
@@ -424,14 +425,15 @@ sub get_config {
        GetOptions(
                   "help|h", \$show_help,
                   "get-svn|g", \$get_svn,
+                  "set-svn|s", \$set_svn,
                   "set-version|v", \$set_version,
                   "set-release|r|package-version|p", \$set_release
                   ) || pod2usage(2);
 
        if ($show_help) { pod2usage(1); }
 
-       if ( !( $show_help || $get_svn || $set_release ) ) {
-               $set_version = 1;
+       if ( !( $show_help || $get_svn || $set_svn || $set_version || $set_release ) ) {
+               $set_svn = 1;
        }
 
        if ($#ARGV >= 0) {
@@ -476,6 +478,10 @@ if ($set_version || $set_release) {
 
        if ($set_release) {
                print "Generating release information\n";
+       } else {
+               print "Resetting release information\n";
+               $revision = 0;
+               $package_string = "";
        }
 
        &update_versioned_files;
@@ -495,11 +501,15 @@ make-version.pl [options] [source directory]
 
     --help, -h                 This help message
     --get-svn, -g              Print the SVN revision and source.
-    --set-version, -v          Set the major, minor, and micro versions.
+    --set-svn, -s              Set the information in svnversion.h
+    --set-version, -v          Set the major, minor, and micro versions in
+                               configure.in, config.nmake, debian/changelog,
+                              and docbook/release_notes.xml.
                                Resets the release information when used by
                               itself.
-    --set-release, -r          Set the release information.
+    --set-release, -r          Set the release information in configure.in
+                               and config.nmake
     --package-version, -p      Deprecated. Same as --set-release.
 
-Options can be used in any combination. If none are specified B<--set-version>
+Options can be used in any combination. If none are specified B<--set-svn>
 is assumed.