the modified parse_changelog().
* scripts/dpkg-gensymbols.pl, scripts/dpkg-source.pl: Likewise.
+ * scripts/dpkg-genchanges.pl: Change logic of -si option to
+ include the original tarball only if the current upstream version differs
+ from the upstream version of the previous changelog entry.
+
2008-01-18 Guillem Jover <guillem@debian.org>
* m4/arch.m4 (_DPKG_ARCHITECTURE): Do not use backticks inside double
lesser priority (when -d is used).
* Fix behaviour of dpkg-shlibdeps when the same binary was passed multiple
times for use in different dependency fields (-d option).
+ * Change logic of -si option of dpkg-genchanges to include the original
+ tarball only if the current upstream version differs from the upstream
+ version of the previous changelog entry. Replaces the heuristic based
+ on revision number (-0, -0.1 or -1). Closes: #28701
[ Updated manpages translations ]
* Fix typo in French. Closes: #460021
haven't been used).
.TP
.B \-si
-By default, or if specified, the original source will be included if the
-version number ends in
-.BR \-0 " or " \-1 ,
-i.e. if the Debian revision part of the version number is
-.BR 0 " or " 1 .
+By default, or if specified, the original source will be included only if
+the upstream version number (the version without epoch and without Debian
+revision) differs from the upstream version number of the previous
+changelog entry.
.TP
.B \-sa
Forces the inclusion of the original source.
use Dpkg::Substvars;
use Dpkg::Vars;
use Dpkg::Changelog qw(parse_changelog);
+use Dpkg::Version qw(parseversion);
textdomain("dpkg-dev");
-m<maintainer> override control's maintainer value.
-e<maintainer> override changelog's maintainer value.
-u<uploadfilesdir> directory with files (default is \`..').
- -si (default) src includes orig for debian-revision 0 or 1.
+ -si (default) src includes orig if new upstream.
-sa source includes orig src.
-sd source is diff and .dsc only.
-q quiet - no informational messages on stderr.
$options{"changelogformat"} = $changelogformat if $changelogformat;
$options{"since"} = $since if $since;
my $changelog = parse_changelog(%options);
+# Change options to retrieve info of the former changelog entry
+delete $options{"since"};
+$options{"count"} = 1;
+$options{"offset"} = 1;
+my ($prev_changelog, $bad_parser);
+eval { # Do not fail if parser failed due to unsupported options
+ $prev_changelog = parse_changelog(%options);
+};
+$bad_parser = 1 if ($@);
# Other initializations
my $control = Dpkg::Control->new($controlfile);
my $fields = Dpkg::Fields::Object->new();
$f2pri{$f} = $pri;
}
- if (($sourcestyle =~ m/i/ && $sversion !~ m/-(0|1|0\.1)$/ ||
+ # Compare upstream version to previous upstream version to decide if
+ # the .orig tarballs must be included
+ my $include_tarball;
+ if (defined($prev_changelog)) {
+ my %cur = parseversion($changelog->{"Version"});
+ my %prev = parseversion($prev_changelog->{"Version"});
+ $include_tarball = ($cur{"version"} ne $prev{"version"}) ? 1 : 0;
+ } else {
+ if ($bad_parser) {
+ # The parser doesn't support extracting a previous version
+ # Fallback to version check
+ $include_tarball = ($sversion =~ /-(0|1|0\.1)$/) ? 1 : 0;
+ } else {
+ # No previous entry means first upload, tarball required
+ $include_tarball = 1;
+ }
+ }
+
+ if ((($sourcestyle =~ m/i/ && not($include_tarball)) ||
$sourcestyle =~ m/d/) &&
grep(m/\.diff\.$comp_regex$/,@sourcefiles)) {
$origsrcmsg= _g("not including original source code in upload");