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

Dpkg::Changelog::Parse: Move options setup to changelog_parse_plugin start

Guillem Jover пре 11 година
родитељ
комит
06f6460c85
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      scripts/Dpkg/Changelog/Parse.pm

+ 5 - 4
scripts/Dpkg/Changelog/Parse.pm

@@ -80,6 +80,11 @@ it is passed as the parameter that follows.
 
 sub changelog_parse_plugin {
     my (%options) = @_;
+
+    # Setup and sanity checks.
+    $options{file} //= 'debian/changelog';
+    my $changelogfile = $options{file};
+
     my @parserpath = ('/usr/local/lib/dpkg/parsechangelog',
                       "$Dpkg::LIBDIR/parsechangelog",
                       '/usr/lib/dpkg/parsechangelog');
@@ -98,10 +103,6 @@ sub changelog_parse_plugin {
 	$force = 1;
     }
 
-    # Set a default filename
-    $options{file} //= 'debian/changelog';
-    my $changelogfile = $options{file};
-
     # Extract the format from the changelog file if possible
     unless ($force or ($changelogfile eq '-')) {
 	local $_;