diff options
author | Slack Coder <slackcoder@server.ky> | 2024-12-10 14:06:06 -0500 |
---|---|---|
committer | Slack Coder <slackcoder@server.ky> | 2025-01-21 15:36:10 -0500 |
commit | ba81bf24d8df5153830f06deb7c2b780fe5c292f (patch) | |
tree | d8c0aefac933b7ed41e4b8faae75b9feaf0b9f1d /SBO-Lib/lib/SBO/App/Snap.pm | |
parent | 82b061208df57c0d1d46b06ffa15ad6846db883b (diff) | |
download | sbotools2-ba81bf24d8df5153830f06deb7c2b780fe5c292f.tar.xz |
GPG verification
Diffstat (limited to 'SBO-Lib/lib/SBO/App/Snap.pm')
-rw-r--r-- | SBO-Lib/lib/SBO/App/Snap.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/SBO-Lib/lib/SBO/App/Snap.pm b/SBO-Lib/lib/SBO/App/Snap.pm index 00aea38..d2b0f57 100644 --- a/SBO-Lib/lib/SBO/App/Snap.pm +++ b/SBO-Lib/lib/SBO/App/Snap.pm @@ -13,12 +13,12 @@ package SBO::App::Snap; use 5.16.0; use strict; use warnings FATAL => 'all'; -use SBO::Lib qw/ fetch_tree update_tree %config show_version /; +use SBO::Lib qw/ fetch_tree import_gpg_key update_tree %config show_version /; use Getopt::Long qw/ GetOptionsFromArray /; use parent 'SBO::App'; -our $VERSION = '2.7.2'; +our $VERSION = '2.7.4'; sub _parse_opts { my $class = shift; @@ -49,6 +49,7 @@ Options: Commands: fetch: initialize a local copy of the slackbuilds.org tree. + import-key [path or url]: import GPG for verifying the slackbuilds.org tree. Defaults to the key shipped with sbotools2. update: update an existing local copy of the slackbuilds.org tree. (generally, you may prefer "sbocheck" over "$fname update") @@ -67,9 +68,17 @@ sub run { $args[0] //= ''; if ($args[0] eq 'fetch') { - fetch_tree() + fetch_tree(); + } elsif ($args[0] eq 'import-key') { + my $key_path_or_url = "/usr/doc/sbotools2-$VERSION/slackbuilds-devel\@slackbuilds.org.asc"; + if ($args[1]) { + $key_path_or_url = $args[1]; + } + my $key_id = $config{'GPG_KEY'}; + + import_gpg_key($key_path_or_url, $key_id); } elsif ($args[0] eq 'update') { - update_tree() + update_tree(); } else { $self->show_usage(); return 1; |