OLD | NEW |
| (Empty) |
1 # Copyright © 2007-2009 Raphaël Hertzog <hertzog@debian.org> | |
2 # | |
3 # This program is free software; you can redistribute it and/or modify | |
4 # it under the terms of the GNU General Public License as published by | |
5 # the Free Software Foundation; either version 2 of the License, or | |
6 # (at your option) any later version. | |
7 # | |
8 # This program is distributed in the hope that it will be useful, | |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 # GNU General Public License for more details. | |
12 # | |
13 # You should have received a copy of the GNU General Public License | |
14 # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
15 | |
16 package Dpkg::Control::Fields; | |
17 | |
18 use strict; | |
19 use warnings; | |
20 | |
21 our $VERSION = '1.00'; | |
22 | |
23 use Carp; | |
24 use Exporter qw(import); | |
25 | |
26 use Dpkg::Control::FieldsCore; | |
27 use Dpkg::Vendor qw(run_vendor_hook); | |
28 | |
29 our @EXPORT = @Dpkg::Control::FieldsCore::EXPORT; | |
30 | |
31 # Register vendor specifics fields | |
32 foreach my $op (run_vendor_hook('register-custom-fields')) { | |
33 next if not (defined $op and ref $op); # Skip when not implemented by vendor | |
34 my $func = shift @$op; | |
35 if ($func eq 'register') { | |
36 &field_register(@$op); | |
37 } elsif ($func eq 'insert_before') { | |
38 &field_insert_before(@$op); | |
39 } elsif ($func eq 'insert_after') { | |
40 &field_insert_after(@$op); | |
41 } else { | |
42 croak "vendor hook register-custom-fields sent bad data: @$op"; | |
43 } | |
44 } | |
45 | |
46 =encoding utf8 | |
47 | |
48 =head1 NAME | |
49 | |
50 Dpkg::Control::Fields - manage (list of official) control fields | |
51 | |
52 =head1 DESCRIPTION | |
53 | |
54 The module contains a list of vendor-neutral and vendor-specific fieldnames | |
55 with associated meta-data explaining in which type of control information | |
56 they are allowed. The vendor-neutral fieldnames and all functions are | |
57 inherited from Dpkg::Control::FieldsCore. | |
58 | |
59 =head1 AUTHOR | |
60 | |
61 Raphaël Hertzog <hertzog@debian.org>. | |
62 | |
63 =cut | |
64 | |
65 1; | |
OLD | NEW |