Debian.pm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright © 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 <http://www.gnu.org/licenses/>.
  15. package Dpkg::Vendor::Debian;
  16. use strict;
  17. use warnings;
  18. our $VERSION = "0.01";
  19. use base qw(Dpkg::Vendor::Default);
  20. use Dpkg::Control::Types;
  21. use Dpkg::Vendor::Ubuntu;
  22. =head1 NAME
  23. Dpkg::Vendor::Debian - Debian vendor object
  24. =head1 DESCRIPTION
  25. This vendor object customize the behaviour of dpkg scripts
  26. for Debian specific actions.
  27. =cut
  28. sub run_hook {
  29. my ($self, $hook, @params) = @_;
  30. if ($hook eq "keyrings") {
  31. return ('/usr/share/keyrings/debian-keyring.gpg',
  32. '/usr/share/keyrings/debian-maintainers.gpg');
  33. } elsif ($hook eq "register-custom-fields") {
  34. return (
  35. [ "register", "Dm-Upload-Allowed",
  36. CTRL_INFO_SRC | CTRL_INDEX_SRC | CTRL_PKG_SRC ],
  37. [ "insert_after", CTRL_INDEX_SRC, "Uploaders", "Dm-Upload-Allowed" ],
  38. [ "insert_after", CTRL_PKG_SRC, "Uploaders", "Dm-Upload-Allowed" ],
  39. );
  40. } elsif ($hook eq "extend-patch-header") {
  41. my ($textref, $ch_info) = @params;
  42. if ($ch_info->{'Closes'}) {
  43. foreach my $bug (split(/\s+/, $ch_info->{'Closes'})) {
  44. $$textref .= "Bug-Debian: http://bugs.debian.org/$bug\n";
  45. }
  46. }
  47. my $b = Dpkg::Vendor::Ubuntu::find_launchpad_closes($ch_info->{'Changes'});
  48. foreach my $bug (@$b) {
  49. $$textref .= "Bug-Ubuntu: https://bugs.launchpad.net/bugs/$bug\n";
  50. }
  51. } else {
  52. return $self->SUPER::run_hook($hook, @params);
  53. }
  54. }
  55. 1;