This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=3e2921dfe31cd27ca177260bfd5f6fab065564ca commit 3e2921dfe31cd27ca177260bfd5f6fab065564ca (HEAD -> main) Author: Guillem Jover <[email protected]> AuthorDate: Fri Dec 30 04:22:57 2022 +0100 Dpkg::Vendor::Devuan: Add new vendor module Add the requested module for this Debian derivative. While ideally this would all be parametrized in fields on the origin files, this is currently not specified, so until that happens, it's convenient to ship this in here. Requested-by: Ivan J. <[email protected]> --- scripts/Dpkg/Vendor/Devuan.pm | 68 +++++++++++++++++++++++++++++++++++++++++++ scripts/Makefile.am | 2 ++ scripts/t/Dpkg_Vendor.t | 4 ++- scripts/t/origins/devuan | 4 +++ t/pod-spell.t | 1 + 5 files changed, 78 insertions(+), 1 deletion(-) diff --git a/scripts/Dpkg/Vendor/Devuan.pm b/scripts/Dpkg/Vendor/Devuan.pm new file mode 100644 index 000000000..661dc9ed1 --- /dev/null +++ b/scripts/Dpkg/Vendor/Devuan.pm @@ -0,0 +1,68 @@ +# Copyright © 2022 Guillem Jover <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +package Dpkg::Vendor::Devuan; + +use strict; +use warnings; + +our $VERSION = '0.01'; + +use parent qw(Dpkg::Vendor::Debian); + +=encoding utf8 + +=head1 NAME + +Dpkg::Vendor::Devuan - Devuan vendor class + +=head1 DESCRIPTION + +This vendor class customizes the behaviour of dpkg scripts for Devuan +specific behavior and policies. + +=cut + +sub run_hook { + my ($self, $hook, @params) = @_; + + if ($hook eq 'package-keyrings') { + return ('/usr/share/keyrings/devuan-keyring.gpg', + '/usr/share/keyrings/devuan-maintainers.gpg'); + } elsif ($hook eq 'archive-keyrings') { + return ('/usr/share/keyrings/devuan-archive-keyring.gpg'); + } elsif ($hook eq 'archive-keyrings-historic') { + return ('/usr/share/keyrings/devuan-archive-removed-keys.gpg'); + } elsif ($hook eq 'extend-patch-header') { + my ($textref, $ch_info) = @params; + if ($ch_info->{'Closes'}) { + foreach my $bug (split(/\s+/, $ch_info->{'Closes'})) { + $$textref .= "Bug-Devuan: https://bugs.devuan.org/$bug\n"; + } + } + } else { + return $self->SUPER::run_hook($hook, @params); + } +} + +=head1 CHANGES + +=head2 Version 0.xx + +This is a private module. + +=cut + +1; diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 7800af98a..41c258a97 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -138,6 +138,7 @@ nobase_dist_perllib_DATA = \ Dpkg/Vendor.pm \ Dpkg/Vendor/Debian.pm \ Dpkg/Vendor/Default.pm \ + Dpkg/Vendor/Devuan.pm \ Dpkg/Vendor/Ubuntu.pm \ Dpkg/Version.pm \ Dpkg.pm \ @@ -383,6 +384,7 @@ test_data = \ t/mock-bin/dpkg \ t/mock-bin/gcc \ t/origins/debian \ + t/origins/devuan \ t/origins/default \ t/origins/gnewsense \ t/origins/ubuntu \ diff --git a/scripts/t/Dpkg_Vendor.t b/scripts/t/Dpkg_Vendor.t index effc86510..121f620d6 100644 --- a/scripts/t/Dpkg_Vendor.t +++ b/scripts/t/Dpkg_Vendor.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 7; # Delete variables that can affect the tests. delete $ENV{DEB_VENDOR}; @@ -32,6 +32,8 @@ is($vendor, 'Debian', 'Check current vendor name'); $obj = get_vendor_object(); is(ref($obj), 'Dpkg::Vendor::Debian', 'Check current vendor object'); +$obj = get_vendor_object('Devuan'); +is(ref($obj), 'Dpkg::Vendor::Devuan', 'Check Devuan vendor object'); $obj = get_vendor_object('gNewSense'); is(ref($obj), 'Dpkg::Vendor::Debian', 'Check parent fallback vendor object'); $obj = get_vendor_object('Ubuntu'); diff --git a/scripts/t/origins/devuan b/scripts/t/origins/devuan new file mode 100644 index 000000000..533314872 --- /dev/null +++ b/scripts/t/origins/devuan @@ -0,0 +1,4 @@ +Vendor: Devuan +Vendor-URL: https://www.devuan.org/ +Bugs: debbugs://bugs.devuan.org +Parent: Debian diff --git a/t/pod-spell.t b/t/pod-spell.t index b831b5222..b6bf46b40 100644 --- a/t/pod-spell.t +++ b/t/pod-spell.t @@ -43,6 +43,7 @@ for my $file (@files) { __DATA__ CVS +Devuan DSC Dpkg IPC -- Dpkg.Org's dpkg

