Package: devscripts
Version: 2.10.11ubuntu5.8.04.1
Severity: normal
Tags: patch

[Originally from Ubuntu LP: #220733; an Ubuntu developer asked me to file a 
Debian bug]

I expected 'dch --create "changelog entry"' to run in batch mode. Instead, it 
created a changelog in interactive mode and opened it in my editor. This makes 
it difficult to use dch --create from a script, which is my goal.

The dch man page says this:
"If the text of the change is given on the command line, debchange will run in 
batch mode and simply add the text, with line breaks as necessary, at the 
appropriate place in debian/changelog (or the changelog specified by options, 
as described below)."

Since I provided the text of the change, I expected dch to run in batch mode.

The attached patch (for devscripts in Ubuntu 8.04) does the following to fix 
the problem:
- Modify debchange.pl to not run the editor if the user passes --create, 
changelog text, --package, and -v.
- Modify debchange.pl to not write the "Initial release" line when changelog 
text is provided on the command line. This is avoids settings @closes_text, 
since the editor is launched whenever @closes_text is set. 


-- System Information:
Debian Release: lenny/sid
  APT prefers hardy-updates
  APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 'hardy')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-17-generic (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages devscripts depends on:
ii  debianutils             2.28.2-0ubuntu1  Miscellaneous utilities specific t
ii  dpkg-dev                1.14.16.6ubuntu3 package building tools for Debian
ii  libc6                   2.7-10ubuntu3    GNU C Library: Shared libraries
ii  perl                    5.8.8-12         Larry Wall's Practical Extraction 
ii  sed                     4.1.5-5          The GNU sed stream editor
ii  wget                    1.10.2-3ubuntu1  retrieves files from the web

Versions of packages devscripts recommends:
ii  debhelper                   6.0.4ubuntu1 helper programs for debian/rules
ii  fakeroot                    1.9ubuntu1   Gives a fake root environment

-- no debconf information
diff -Nru devscripts-2.10.11ubuntu5.8.04.1/debian/changelog 
devscripts-2.10.11ubuntu5.8.04.1msg1/debian/changelog
--- devscripts-2.10.11ubuntu5.8.04.1/debian/changelog   2008-05-07 
05:05:03.000000000 -0400
+++ devscripts-2.10.11ubuntu5.8.04.1msg1/debian/changelog       2008-06-03 
14:12:37.000000000 -0400
@@ -1,3 +1,12 @@
+devscripts (2.10.11ubuntu5.8.04.1msg1) hardy; urgency=low
+
+  * scripts/debchange.pl: Don't launch the editor when user passes a 
+    changelog entry to dch --create --package -v (LP: #220733)
+  * scripts/debchange.pl: Suppress "initial release" text when user 
+    passes a changelog entry to dch --create
+
+ -- Steve Magoun <[EMAIL PROTECTED]>  Tue, 03 Jun 2008 14:12:24 -0400
+
 devscripts (2.10.11ubuntu5.8.04.1) hardy-proposed; urgency=low
 
   * SRU to fix LP: #205388 - "Dch won't allow non-Ubuntu distros for -D
diff -Nru /tmp/QUoT1CUXdy/devscripts-2.10.11ubuntu5.8.04.1/scripts/debchange.pl 
/tmp/SiTeS8zIJR/devscripts-2.10.11ubuntu5.8.04.1msg1/scripts/debchange.pl
--- devscripts-2.10.11ubuntu5.8.04.1/scripts/debchange.pl       2008-05-07 
05:05:03.000000000 -0400
+++ devscripts-2.10.11ubuntu5.8.04.1msg1/scripts/debchange.pl   2008-06-03 
14:08:04.000000000 -0400
@@ -1151,7 +1151,7 @@
     $line=0;
 }
 elsif ($opt_create) {
-    if (! $initial_release and ! $opt_news) {
+    if (! $initial_release and ! $opt_news and ! $TEXT and ! $EMPTY_TEXT) {
        push @closes_text, "Initial release. (Closes: \#XXXXXX)\n";
     }
 
@@ -1190,7 +1190,7 @@
 }
 
 # Now Run the Editor; always run if doing "closes" to give a chance to check
-if ((!$TEXT and !$EMPTY_TEXT) or @closes_text or $opt_create) {
+if ((!$TEXT and !$EMPTY_TEXT) or @closes_text or ($opt_create && ! 
($opt_package && $opt_v))) {
     my $mtime = (stat("$changelog_path.dch"))[9];
     defined $mtime or fatal
        "Error getting modification time of temporary $changelog_path: $!";

Reply via email to