Hi,
On Tue, 2008-06-03 at 14:23 -0400, Steve Magoun wrote:
> Package: devscripts
> Version: 2.10.11ubuntu5.8.04.1
[...]
> [Originally from Ubuntu LP: #220733; an Ubuntu developer asked me to file a
> Debian bug]
Thanks for the patch. [As an aside, in general (and imho) it makes life
much easier if patches submitted against Debian packages are based on
the appropriate Debian package rather than an Ubuntu package. Either
way, filing them against a version that's been in Debian (i.e. 2.10.11)
would be appreciated as it allows the Bug Tracking System's version
tracking features to determine which versions of the Debian package are
known to contain the bug]
In this specific case, the first half of the patch failed to apply as
the Debian package already includes a --empty option which allows the
addition of no changelog entries on create. (This would also have been
the case if you'd patched the intrepid package rather than the hardy
package, btw, as intrepid includes --empty :-)
> 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.
I've applied a modified version of your patch to the Debian package, and
attached the diff. The new version should apply as-is to the intrepid
package but will need some modification (i.e. the removal of the two
sections related to --empty) to apply to hardy.
Although they're hopefully self-explanatory, for completeness the
changes are:
* don't run the editor if "dch --create --empty --package foo
--newversion bar" is used (no text provided, but --empty overrides that
requirement anyway)
* check for a package that's not "PACKAGE" and version other than
"VERSION" rather than the explicit use of --package and -v, as it's
possible for one or both of the values to be set via --fromdirname.
Please don't take any of the above as a criticism of your original
patch, or discouragement from submitting patches in future.
Regards,
Adam
Index: debian/changelog
===================================================================
--- debian/changelog (revision 1477)
+++ debian/changelog (working copy)
@@ -1,6 +1,13 @@
devscripts (2.10.30) UNRELEASED; urgency=low
- * NOT RELEASED YET
+ * debchange:
+ + Don't automatically open an editor when creating a new changelog if
+ a package name and version are supplied and either --empty was used
+ or the text of a changelog entry was supplied on the command line.
+ Based on a patch from Steve Magoun (Closes: #4843334)
+ + Don't automatically add an "initial release" stanza to a newly created
+ changelog if the text of a changelog entry was supplied on the command
+ line. Thanks Steve Magoun.
-- Adam D. Barratt <[EMAIL PROTECTED]> Tue, 03 Jun 2008 21:15:58 +0100
Index: scripts/debchange.pl
===================================================================
--- scripts/debchange.pl (revision 1428)
+++ scripts/debchange.pl (working copy)
@@ -1245,7 +1245,8 @@
$line=0;
}
elsif ($opt_create) {
- if (! $initial_release and ! $opt_news and ! $opt_empty) {
+ if (! $initial_release and ! $opt_news and ! $opt_empty and
+ ! $TEXT and ! $EMPTY_TEXT) {
push @closes_text, "Initial release. (Closes: \#XXXXXX)\n";
}
@@ -1286,7 +1287,9 @@
}
# 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 and ! ($opt_create and $opt_empty)) or @closes_text or
+ ($opt_create and ! ($PACKAGE ne 'PACKAGE' and $VERSION ne 'VERSION'))) {
+
my $mtime = (stat("$changelog_path.dch"))[9];
defined $mtime or fatal
"Error getting modification time of temporary $changelog_path: $!";