diff options
author | Francois Pons <fpons@mandriva.com> | 2003-08-11 14:04:35 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-08-11 14:04:35 +0000 |
commit | 9d5c3d93c70a758b4d4abf34b3f31ed06142da8b (patch) | |
tree | e15d16dbc769ca276a348508ed404dcaaea9eb22 /URPM | |
parent | b020aab28e81fd405cc0585c2c0928d2bdd134a0 (diff) | |
download | perl-URPM-9d5c3d93c70a758b4d4abf34b3f31ed06142da8b.tar perl-URPM-9d5c3d93c70a758b4d4abf34b3f31ed06142da8b.tar.gz perl-URPM-9d5c3d93c70a758b4d4abf34b3f31ed06142da8b.tar.bz2 perl-URPM-9d5c3d93c70a758b4d4abf34b3f31ed06142da8b.tar.xz perl-URPM-9d5c3d93c70a758b4d4abf34b3f31ed06142da8b.zip |
0.93-2mdk
Diffstat (limited to 'URPM')
-rw-r--r-- | URPM/Signature.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/URPM/Signature.pm b/URPM/Signature.pm index d9c5b2f..7b90693 100644 --- a/URPM/Signature.pm +++ b/URPM/Signature.pm @@ -35,7 +35,7 @@ sub parse_pubkeys { #- parse an armored file and import in keys hash if the key does not already exists. sub parse_armored_file { - my ($urpm, $file) = @_; + my ($urpm, $file, %options) = @_; my ($block, @l, $content); local (*F, $_); @@ -64,13 +64,15 @@ sub parse_armored_file { @l < 1 and die "no key found while parsing armored file"; #- check if key has been found, remove from list. - @l = grep { - my $found = 0; - foreach my $k (values %{$urpm->{keys} || {}}) { - $k->{content} eq $_ and $found = 1, last; - } - !$found; - } @l; + if ($options{only_unknown_keys}) { + @l = grep { + my $found = 0; + foreach my $k (values %{$urpm->{keys} || {}}) { + $k->{content} eq $_ and $found = 1, last; + } + !$found; + } @l; + } #- now return something (true) which reflect what should be found in keys. map { +{ content => $_ } } @l; @@ -80,7 +82,7 @@ sub import_armored_file { my ($urpm, $file, %options) = @_; #- this is a tempory operation currently... - system "$ENV{LD_LOADER} rpm ".($options{root} && "--root '$options{root}'" || "")."--import '$file'" == 0 or + system("rpm", ($options{root} ? ("--root", $options{root}) : @{[]}), "--import", $file) == 0 or die "import of armored file failed"; } 1; |