Author: adsb
Date: 2009-05-02 17:01:19 +0000 (Sat, 02 May 2009)
New Revision: 1867

Modified:
   trunk/conf.default.in
   trunk/debian/changelog
   trunk/debian/postinst
   trunk/scripts/debchange.1
   trunk/scripts/debchange.pl
Log:
* debchange:
  + Mention in the help output and manpage that a dummy changelog entry
    may be supplied in conjunction with --release in order to avoid
    spawning an editor.
  + Add a configuration variable and command line option to allow the
    recent change to --release's "auto-save" behaviour to be disabled.
    For consistency with other debchange options, the default is to
    retain the behaviour introduced in 2.10.48 - i.e. that the changelog
    must be explicitly saved after the use of --release. (Closes: #524393)

Modified: trunk/conf.default.in
===================================================================
--- trunk/conf.default.in       2009-04-30 22:19:59 UTC (rev 1866)
+++ trunk/conf.default.in       2009-05-02 17:01:19 UTC (rev 1867)
@@ -200,6 +200,11 @@
 # Attempt to automatically determine whether the current changelog
 # stanza represents an NMU?
 # DEBCHANGE_AUTO_NMU=yes
+#
+# When --release was used and an editor presented, force the changelog
+# to be explicitly saved in the editor?  If this is set to "no" then
+# the changes made by --release will be automatically saved.
+# DEBCHANGE_FORCE_SAVE_ON_RELEASE=yes
 
 ##### debcheckout
 #

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2009-04-30 22:19:59 UTC (rev 1866)
+++ trunk/debian/changelog      2009-05-02 17:01:19 UTC (rev 1867)
@@ -1,6 +1,15 @@
 devscripts (2.10.49) UNRELEASED; urgency=low
 
-  * debchange: Use == for numeric comparison, not eq.
+  * debchange:
+    + Use == for numeric comparison, not eq.
+    + Mention in the help output and manpage that a dummy changelog entry
+      may be supplied in conjunction with --release in order to avoid
+      spawning an editor.
+    + Add a configuration variable and command line option to allow the
+      recent change to --release's "auto-save" behaviour to be disabled.
+      For consistency with other debchange options, the default is to
+      retain the behaviour introduced in 2.10.48 - i.e. that the changelog
+      must be explicitly saved after the use of --release. (Closes: #524393)
   * debcommit: If the installed version of dpkg-dev supports retrieving a
     list of appropriate bugs, automatically generate bzr --fixes arguments
     for Launchpad bugs as well as Debian bugs.  Thanks, Colin Watson.

Modified: trunk/debian/postinst
===================================================================
--- trunk/debian/postinst       2009-04-30 22:19:59 UTC (rev 1866)
+++ trunk/debian/postinst       2009-05-02 17:01:19 UTC (rev 1867)
@@ -675,6 +675,14 @@
 #
 # Default URL to use if none is specified on the command line.
 # RMADISON_DEFAULT_URL=debian
+
+#### debchange option added in 2.10.49
+#
+# When --release was used and an editor presented, force the changelog
+# to be explicitly saved in the editor?  If this is set to "no" then
+# the changes made by --release will be automatically saved.
+# DEBCHANGE_FORCE_SAVE_ON_RELEASE=yes
+
 EOF
        fi
     fi

Modified: trunk/scripts/debchange.1
===================================================================
--- trunk/scripts/debchange.1   2009-04-30 22:19:59 UTC (rev 1866)
+++ trunk/scripts/debchange.1   2009-05-02 17:01:19 UTC (rev 1867)
@@ -172,6 +172,17 @@
 no previous changelog entries and an explicit distribution has not been 
 specified, \fIunstable\fR will be used.
 .TP
+.BR \-\-force\-save\-on\-release
+When \-\-release is used and an editor opened to allow inspection
+of the changelog, force the file to be saved in the editor even
+if no further changes are made. (default)
+.TP
+.BR \-\-no\-force\-save\-on\-release
+Do not do so. Note that a dummy changelog entry made be supplied
+in order to achieve the same effect - e.g. \fBdebchange \-\-release ""\fR.
+The entry will not be added to the changelog but its presence will suppress
+the editor.
+.TP
 .BR \-\-create
 This will create a new \fIdebian/changelog\fR file (or \fINEWS\fR if
 the \fB\-\-news\fR option is used).  You must be in the top-level
@@ -393,6 +404,10 @@
 automatically determine whether the current changelog stanza represents
 an NMU.  The default is \fIyes\fR.  See the discussion of the
 \fB\-\-nmu\fR option above.
+.TP
+.BR DEBCHANGE_FORCE_SAVE_ON_RELEASE
+If this is set to \fIno\fR, then it is the same as the
+\fB\-\-no\-force\-save\-on\-release\fR command line parameter being used.
 .SH ENVIRONMENT
 .TP
 .BR DEBEMAIL ", " EMAIL ", " DEBFULLNAME ", " NAME

Modified: trunk/scripts/debchange.pl
===================================================================
--- trunk/scripts/debchange.pl  2009-04-30 22:19:59 UTC (rev 1866)
+++ trunk/scripts/debchange.pl  2009-05-02 17:01:19 UTC (rev 1867)
@@ -87,6 +87,15 @@
          Update the changelog timestamp. If the distribution is set to
          "UNRELEASED", change it to unstable (or another distribution as
          specified by --distribution).
+  --force-save-on-release
+         When --release is used and an editor opened to allow inspection
+         of the changelog, force the file to be saved in the editor even
+         if no further changes are made. (default)
+  --no-force-save-on-release
+         Do not do so. Note that a dummy changelog entry made be supplied
+         in order to achieve the same effect - e.g. $progname --release ""
+         The entry will not be added to the changelog but its presence will
+         suppress the editor
   --create
          Create a new changelog (default) or NEWS file (with --news) and
          open for editing
@@ -202,6 +211,7 @@
 my $opt_t = '';
 my $opt_allow_lower = '';
 my $opt_auto_nmu = 'yes';
+my $opt_force_save_on_release = 1;
 
 # Next, read configuration files and then command line
 # The next stuff is boilerplate
@@ -223,6 +233,7 @@
                       'DEBCHANGE_MAINTTRAILER' => '',
                       'DEBCHANGE_LOWER_VERSION_PATTERN' => '',
                       'DEBCHANGE_AUTO_NMU' => 'yes',
+                      'DEBCHANGE_FORCE_SAVE_ON_RELEASE' => 'yes',
                       );
     $config_vars{'DEBCHANGE_TZ'} ||= '';
     my %config_default = %config_vars;
@@ -254,6 +265,8 @@
        or $config_vars{'DEBCHANGE_MULTIMAINT_MERGE'}='no';
     $config_vars{'DEBCHANGE_AUTO_NMU'} =~ /^(yes|no)$/
        or $config_vars{'DEBCHANGE_AUTO_NMU'}='yes';
+    $config_vars{'DEBCHANGE_FORCE_SAVE_ON_RELEASE'} =~ /^(yes|no)$/
+       or $config_vars{'DEBCHANGE_FORCE_SAVE_ON_RELEASE'}='yes';
 
     foreach my $var (sort keys %config_vars) {
        if ($config_vars{$var} ne $config_default{$var}) {
@@ -275,6 +288,8 @@
        if $config_vars{'DEBCHANGE_MAINTTRAILER'};
     $opt_allow_lower = $config_vars{'DEBCHANGE_LOWER_VERSION_PATTERN'};
     $opt_auto_nmu = $config_vars{'DEBCHANGE_AUTO_NMU'};
+    $opt_force_save_on_release =
+       $config_vars{'DEBCHANGE_FORCE_SAVE_ON_RELEASE'} eq 'yes' ? 1 : 0;
 }
 
 # We use bundling so that the short option behaviour is the same as
@@ -325,6 +340,7 @@
           "release-heuristic=s" => \$opt_release_heuristic,
           "empty" => \$opt_empty,
           "auto-nmu!" => \$opt_auto_nmu,
+          "force-save-on-release!" => \$opt_force_save_on_release,
           )
     or die "Usage: $progname [options] [changelog entry]\nRun $progname --help 
for more details\n";
 
@@ -1351,7 +1367,9 @@
        my $newmtime = (stat("$changelog_path.dch"))[9];
        defined $newmtime or fatal
            "Error getting modification time of temporary $changelog_path: $!";
-       if ($mtime == $newmtime && ! $opt_create) {
+       if ($mtime == $newmtime && ! $opt_create &&
+           (!$opt_r || ($opt_r && $opt_force_save_on_release))) {
+
            warn "$progname: $changelog_path unmodified; exiting.\n";
            exit 0;
        }



-- 
To unsubscribe, send mail to [email protected].

Reply via email to