Debian.pm 2.1 KB

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