Просмотр исходного кода

dpkg-genchanges, dpkg-gencontrol: do not hardcode the field output order

The right field output order is automatically set based on the type
of the Dpkg::Control object used.
Raphaël Hertzog лет назад: 17
Родитель
Сommit
293c6541c3
2 измененных файлов с 1 добавлено и 13 удалено
  1. 0 6
      scripts/dpkg-genchanges.pl
  2. 1 7
      scripts/dpkg-gencontrol.pl

+ 0 - 6
scripts/dpkg-genchanges.pl

@@ -23,11 +23,6 @@ use Dpkg::Vendor qw(run_vendor_hook);
 
 textdomain("dpkg-dev");
 
-my @changes_fields = qw(Format Date Source Binary Architecture Version
-                        Distribution Urgency Maintainer Changed-By
-                        Description Closes Changes Checksums-Md5
-                        Checksums-Sha1 Checksums-Sha256 Files);
-
 my $controlfile = 'debian/control';
 my $changelogfile = 'debian/changelog';
 my $changelogformat;
@@ -541,7 +536,6 @@ for my $f (keys %remove) {
     delete $fields->{$f};
 }
 
-$fields->set_output_order(@changes_fields);
 run_vendor_hook('before-changes-creation', $fields);
 $fields->output(\*STDOUT); # Note: no substitution of variables
 

+ 1 - 7
scripts/dpkg-gencontrol.pl

@@ -10,9 +10,9 @@ use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use Dpkg::Arch qw(get_host_arch debarch_eq debarch_is);
 use Dpkg::Deps;
-use Dpkg::Fields qw(:list unknown);
 use Dpkg::Control;
 use Dpkg::Control::Info;
+use Dpkg::Control::Fields;
 use Dpkg::Substvars;
 use Dpkg::Vars;
 use Dpkg::Changelog qw(parse_changelog);
@@ -20,11 +20,6 @@ use Dpkg::Changelog qw(parse_changelog);
 textdomain("dpkg-dev");
 
 my @pkg_dep_fields = field_list_pkg_dep();
-my @control_fields = (qw(Package Package-Type Source Version Kernel-Version
-                         Architecture Subarchitecture Installer-Menu-Item
-                         Essential Origin Bugs Maintainer Installed-Size),
-                      @pkg_dep_fields,
-                      qw(Section Priority Multi-Arch Homepage Description Tag));
 
 my $controlfile = 'debian/control';
 my $changelogfile = 'debian/changelog';
@@ -364,7 +359,6 @@ if (!$stdout) {
     $fh_output = \*STDOUT;
 }
 
-$fields->set_output_order(@control_fields);
 $fields->apply_substvars($substvars);
 $fields->output($fh_output);