Sfoglia il codice sorgente

Register field Dm-Upload-Allowed as Debian specific

Raphaël Hertzog 17 anni fa
parent
commit
7aa35855a7
2 ha cambiato i file con 10 aggiunte e 7 eliminazioni
  1. 1 4
      scripts/Dpkg/Control/Fields.pm
  2. 9 3
      scripts/Dpkg/Vendor/Debian.pm

+ 1 - 4
scripts/Dpkg/Control/Fields.pm

@@ -114,9 +114,6 @@ our %FIELDS = (
     'Distribution' => {
         allowed => ALL_CHANGES,
     },
-    'Dm-Upload-Allowed' => {
-        allowed => ALL_SRC,
-    },
     'Enhances' => {
         allowed => ALL_PKG,
         dependency => 'union',
@@ -283,7 +280,7 @@ our %FIELD_ORDER = (
     ],
     CTRL_PKG_SRC() => [
         qw(Format Source Binary Architecture Version Origin Maintainer
-        Uploaders Dm-Upload-Allowed Homepage Standards-Version Vcs-Browser
+        Uploaders Homepage Standards-Version Vcs-Browser
         Vcs-Arch Vcs-Bzr Vcs-Cvs Vcs-Darcs Vcs-Git Vcs-Hg Vcs-Mtn
         Vcs-Svn), &field_list_src_dep(), @checksum_fields, qw(Files)
     ],

+ 9 - 3
scripts/Dpkg/Vendor/Debian.pm

@@ -19,9 +19,8 @@ package Dpkg::Vendor::Debian;
 use strict;
 use warnings;
 
-use Dpkg::Vendor::Default;
-
-our @ISA = qw(Dpkg::Vendor::Default);
+use base qw(Dpkg::Vendor::Default);
+use Dpkg::Control::Types;
 
 =head1 NAME
 
@@ -44,6 +43,13 @@ sub run_hook {
     } elsif ($hook eq "keyrings") {
         return ('/usr/share/keyrings/debian-keyring.gpg',
                 '/usr/share/keyrings/debian-maintainers.gpg');
+    } elsif ($hook eq "register-custom-fields") {
+        return (
+            [ "register", "Dm-Upload-Allowed",
+              CTRL_INFO_SRC | CTRL_APT_SRC | CTRL_PKG_SRC ],
+            [ "insert_after", CTRL_APT_SRC, "Uploaders", "Dm-Upload-Allowed" ],
+            [ "insert_after", CTRL_PKG_SRC, "Uploaders", "Dm-Upload-Allowed" ],
+        );
     }
 }