diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:42:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:42:36 +0000 |
commit | f3cd649313063ef9d72a3a4a0ab5b4af598c8c9f (patch) | |
tree | 47e771e246377a3ee1211bdb2238e090970d6c24 /scripts/Test | |
parent | Releasing progress-linux version 1.22.5-0.0~progress7.99u1. (diff) | |
download | dpkg-f3cd649313063ef9d72a3a4a0ab5b4af598c8c9f.tar.xz dpkg-f3cd649313063ef9d72a3a4a0ab5b4af598c8c9f.zip |
Merging upstream version 1.22.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/Test')
-rw-r--r-- | scripts/Test/Dpkg.pm | 43 |
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 |