Author: adam-guest
Date: 2008-04-11 21:30:02 +0000 (Fri, 11 Apr 2008)
New Revision: 1332

Modified:
   trunk/debian/changelog
   trunk/scripts/debchange.1
   trunk/scripts/debchange.pl
Log:
debchange: Allow a changelog with no entries to be created. (Note that
such a changelog will cause a warning from dpkg-parsehchangelog the
next time debchange is used with it) (Closes: #475578)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-04-11 20:55:34 UTC (rev 1331)
+++ trunk/debian/changelog      2008-04-11 21:30:02 UTC (rev 1332)
@@ -1,5 +1,8 @@
 devscripts (2.10.26) UNRELEASED; urgency=low
 
+  * debchange: Allow a changelog with no entries to be created. (Note that
+    such a changelog will cause a warning from dpkg-parsehchangelog the
+    next time debchange is used with it) (Closes: #475578)
   * debcommit: Modify the "strip message" functionality so that:
     - Changelog lines beginning with any of *, + or - are considered to
       indicate a "change" for the purposes of deciding whether to strip 

Modified: trunk/scripts/debchange.1
===================================================================
--- trunk/scripts/debchange.1   2008-04-11 20:55:34 UTC (rev 1331)
+++ trunk/scripts/debchange.1   2008-04-11 21:30:02 UTC (rev 1332)
@@ -184,6 +184,13 @@
 distribution is specified either using the \fB\-\-distribution\fR
 option or in the generated changelog file.
 .TP
+.BR \-\-empty
+When used in combination with \fB\-\-create\fR, suppress the automatic
+addition of an "initial release" changelog entry (so that the next
+invocation of \fBdebchange\fR adds the first entry).  Note that this
+will cause a \fBdpkg\-parsechangelog\fR warning on the next invocation
+due to the lack of changes.
+.TP
 \fB\-\-package\fR \fIpackage\fR
 This specifies the package name to be used in the new changelog; this
 may only be used in conjunction with the \fB\-\-create\fR option.

Modified: trunk/scripts/debchange.pl
===================================================================
--- trunk/scripts/debchange.pl  2008-04-11 20:55:34 UTC (rev 1331)
+++ trunk/scripts/debchange.pl  2008-04-11 21:30:02 UTC (rev 1332)
@@ -90,6 +90,9 @@
   --create
          Create a new changelog (default) or NEWS file (with --news) and
          open for editing
+  --empty
+         When creating a new changelog, don't add any changes to it
+         (i.e. only include the header and trailer lines)
   --package <package>
          Specify the package name when using --create (optional)
   -n, --nmu
@@ -275,7 +278,7 @@
 my ($opt_i, $opt_a, $opt_e, $opt_r, $opt_v, $opt_b, $opt_d, $opt_D, $opt_u, 
$opt_force_dist);
 my ($opt_n, $opt_bn, $opt_qa, $opt_s, $opt_bpo, $opt_l, $opt_c, $opt_m, 
$opt_create, $opt_package, @closes);
 my ($opt_news);
-my ($opt_ignore, $opt_level, $opt_regex, $opt_noconf);
+my ($opt_ignore, $opt_level, $opt_regex, $opt_noconf, $opt_empty);
 
 Getopt::Long::Configure('bundling');
 GetOptions("help|h" => \$opt_help,
@@ -315,6 +318,7 @@
           "noconf" => \$opt_noconf,
           "no-conf" => \$opt_noconf,
           "release-heuristic=s" => \$opt_release_heuristic,
+          "empty" => \$opt_empty,
           )
     or die "Usage: $progname [options] [changelog entry]\nRun $progname --help 
for more details\n";
 
@@ -1230,7 +1234,7 @@
     $line=0;
 }
 elsif ($opt_create) {
-    if (! $initial_release and ! $opt_news) {
+    if (! $initial_release and ! $opt_news and ! $opt_empty) {
        push @closes_text, "Initial release. (Closes: \#XXXXXX)\n";
     }
 
@@ -1242,6 +1246,8 @@
        if (length $TEXT) { format_line($TEXT, 1); }
     } elsif ($opt_news) {
        print O "  \n";
+    } elsif ($opt_empty) {
+       # Do nothing, but skip the empty entry
     } else { # this can't happen, but anyway...
        print O "  * \n";
     }



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to