Fields.pm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. package Dpkg::Control::Fields;
  16. use strict;
  17. use warnings;
  18. our $VERSION = '1.00';
  19. our @EXPORT = @Dpkg::Control::FieldsCore::EXPORT;
  20. use Carp;
  21. use Exporter qw(import);
  22. use Dpkg::Control::FieldsCore;
  23. use Dpkg::Vendor qw(run_vendor_hook);
  24. # Register vendor specifics fields
  25. foreach my $op (run_vendor_hook('register-custom-fields')) {
  26. next if not (defined $op and ref $op); # Skip when not implemented by vendor
  27. my $func = shift @$op;
  28. if ($func eq 'register') {
  29. &field_register(@$op);
  30. } elsif ($func eq 'insert_before') {
  31. &field_insert_before(@$op);
  32. } elsif ($func eq 'insert_after') {
  33. &field_insert_after(@$op);
  34. } else {
  35. croak "vendor hook register-custom-fields sent bad data: @$op";
  36. }
  37. }
  38. =encoding utf8
  39. =head1 NAME
  40. Dpkg::Control::Fields - manage (list of official) control fields
  41. =head1 DESCRIPTION
  42. The module contains a list of vendor-neutral and vendor-specific fieldnames
  43. with associated meta-data explaining in which type of control information
  44. they are allowed. The vendor-neutral fieldnames and all functions are
  45. inherited from Dpkg::Control::FieldsCore.
  46. =head1 CHANGES
  47. =head2 Version 1.00 (dpkg 1.15.6)
  48. Mark the module as public.
  49. =cut
  50. 1;