Преглед изворни кода

Drop compatibility with old changelog parsers (as planned)

Raphaël Hertzog пре 16 година
родитељ
комит
bb9af2d083
3 измењених фајлова са 15 додато и 32 уклоњено
  1. 12 12
      doc/README.feature-removal-schedule
  2. 0 7
      scripts/Dpkg/Changelog/Parse.pm
  3. 3 13
      scripts/dpkg-genchanges.pl

+ 12 - 12
doc/README.feature-removal-schedule

@@ -25,18 +25,6 @@ Warning: program
 Why:
  This option has been superseded by -tudeb.
 
-What: support of custom changelog parsers understanding only -v
-Status: obsolete
-When: 1.15.x
-Warning: none
-Why:
- The debian changelog parser has been enhanced. It supports new options
- that enable more fine-grained retrieval of information. Those new options
- will be used by scripts (like dpkg-genchanges).
- .
- Custom changelog parsers must be updated to support the new API (see
- dpkg-parsechangelog(1) and README.api).
-
 What: support of PGP
 Status: deprecated
 When: 1.15.x
@@ -99,3 +87,15 @@ When: 1.15.1
 Why:
  Should switch to use 'date -R'.
 
+What: support of custom changelog parsers understanding only -v
+Status: removed
+Since: 1.15.5
+Why:
+ The debian changelog parser has been enhanced. It supports new options
+ that enable more fine-grained retrieval of information. Those new options
+ will be used by scripts (like dpkg-genchanges).
+ .
+ Custom changelog parsers must be updated to support the new API (see
+ dpkg-parsechangelog(1) and README.api).
+
+

+ 0 - 7
scripts/Dpkg/Changelog/Parse.pm

@@ -93,13 +93,6 @@ sub changelog_parse {
 	delete $options{"changelogformat"};
 	$force = 1;
     }
-    # XXX: For compatibility with old parsers, don't use --since but -v
-    # This can be removed later (in lenny+1 for example)
-    if (exists $options{"since"}) {
-	my $since = $options{"since"};
-	$options{"-v$since"} = undef;
-	delete $options{"since"};
-    }
 
     # Extract the format from the changelog file if possible
     unless($force or ($changelogfile eq "-")) {

+ 3 - 13
scripts/dpkg-genchanges.pl

@@ -190,11 +190,7 @@ my $changelog = changelog_parse(%options);
 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 = changelog_parse(%options);
-};
-$bad_parser = 1 if ($@);
+my $prev_changelog = changelog_parse(%options);
 # Other initializations
 my $control = Dpkg::Control::Info->new($controlfile);
 my $fields = Dpkg::Control->new(type => CTRL_FILE_CHANGES);
@@ -430,14 +426,8 @@ if (!is_binaryonly) {
 	my $prev = Dpkg::Version->new($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;
-	}
+	# No previous entry means first upload, tarball required
+	$include_tarball = 1;
     }
 
     if ((($sourcestyle =~ m/i/ && not($include_tarball)) ||