diff options
Diffstat (limited to 'SBO-Lib/lib/SBO/App')
| -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;  | 
