Debian.pm 2.0 KB

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