summaryrefslogtreecommitdiffstats
path: root/scripts/Test/Dpkg.pm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:42:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:42:28 +0000
commit33a2bb70562ae87235c9be95722a963129a13a38 (patch)
tree15839c3590b802065af623ef71fce4f75f561eed /scripts/Test/Dpkg.pm
parentAdding upstream version 1.22.5. (diff)
downloaddpkg-33a2bb70562ae87235c9be95722a963129a13a38.tar.xz
dpkg-33a2bb70562ae87235c9be95722a963129a13a38.zip
Adding upstream version 1.22.6.upstream/1.22.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/Test/Dpkg.pm')
-rw-r--r--scripts/Test/Dpkg.pm43
1 files changed, 32 insertions, 11 deletions
diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm
index 1632ad8..ce98be2 100644
--- a/scripts/Test/Dpkg.pm
+++ b/scripts/Test/Dpkg.pm
@@ -47,6 +47,7 @@ our @EXPORT_OK = qw(
test_needs_openpgp_backend
test_needs_srcdir_switch
test_neutralize_checksums
+ test_get_openpgp_backend
);
our %EXPORT_TAGS = (
needs => [ qw(
@@ -197,21 +198,41 @@ sub test_needs_command
}
}
+my %openpgp_command = (
+ 'gpg-sq' => {
+ backend => 'gpg',
+ },
+ 'gpg' => {
+ backend => 'gpg',
+ },
+ 'sq' => {
+ backend => 'sq',
+ },
+ 'sqop' => {
+ backend => 'sop',
+ },
+ 'pgpainless-cli' => {
+ backend => 'sop',
+ },
+);
+
sub test_needs_openpgp_backend
{
- my @backends = qw(
- gpg-sq
- gpg
- sq
- sqop
- pgpainless-cli
- );
- my @cmds = grep { can_run($_) } @backends;
- if (@cmds == 0) {
- plan skip_all => "requires >= 1 openpgp command: @backends";
+ my @cmds = sort keys %openpgp_command;
+ my @have_cmds = grep { can_run($_) } @cmds;
+ if (@have_cmds == 0) {
+ plan skip_all => "requires >= 1 openpgp command: @cmds";
}
- return @cmds;
+ return @have_cmds;
+}
+
+sub test_get_openpgp_backend
+{
+ my $cmd = shift;
+
+ return 'auto' if $cmd eq 'auto';
+ return $openpgp_command{$cmd}{backend};
}
sub test_needs_srcdir_switch