From bd523c4594e10c3532748c5c52482b481da6e7fc Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 29 Apr 2005 16:16:22 +0000 Subject: Add a "nopubkey" global option in urpmi.cfg --- man/C/urpmi.cfg.5 | 4 ++++ urpm.pm | 10 ++++++---- urpm/cfg.pm | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/man/C/urpmi.cfg.5 b/man/C/urpmi.cfg.5 index c96a1083..ee13cf85 100644 --- a/man/C/urpmi.cfg.5 +++ b/man/C/urpmi.cfg.5 @@ -63,6 +63,10 @@ Same as \fB--limit-rate\fP for all tools. This option allows to control download speed, there is no limitation by default. The number is given in kilo-bytes per second, unless a suffix \fBK\fP, \fBM\fP is added. +.TP +.B nopubkey +Don't import pubkeys when updating media. + .TP .B noreconfigure Specifies that the media should not be reconfigured (by a reconfiguration file diff --git a/urpm.pm b/urpm.pm index 3bfc720f..e7c62bc0 100644 --- a/urpm.pm +++ b/urpm.pm @@ -155,6 +155,7 @@ sub read_config { verify-rpm norebuild strict-arch + nopubkey )) { if (defined $config->{''}{$opt} && !exists $urpm->{options}{$opt}) { $urpm->{options}{$opt} = $config->{''}{$opt}; @@ -996,8 +997,9 @@ sub update_media { $urpm->{media} or return; # verify that configuration has been read + my $nopubkey = $options{nopubkey} || $urpm->{options}{nopubkey}; #- get gpg-pubkey signature. - if (!$options{nopubkey}) { + if (!$nopubkey) { $urpm->exlock_rpm_db; $urpm->{keys} or $urpm->parse_pubkeys(root => $urpm->{root}); } @@ -1364,7 +1366,7 @@ this could happen if you mounted manually the directory when creating the medium } #- examine if a local pubkey file is available. - if (!$options{nopubkey} && $medium->{hdlist} ne 'pubkey' && !$medium->{'key-ids'}) { + if (!$nopubkey && $medium->{hdlist} ne 'pubkey' && !$medium->{'key-ids'}) { my $path_pubkey = reduce_pathname("$with_hdlist_dir/../" . _guess_pubkey_name($medium)); -e $path_pubkey or $path_pubkey = "$dir/pubkey"; if ($path_pubkey) { @@ -1654,7 +1656,7 @@ this could happen if you mounted manually the directory when creating the medium } #- retrieve pubkey file. - if (!$options{nopubkey} && $medium->{hdlist} ne 'pubkey' && !$medium->{'key-ids'}) { + if (!$nopubkey && $medium->{hdlist} ne 'pubkey' && !$medium->{'key-ids'}) { my $local_pubkey = _guess_pubkey_name($medium); foreach (reduce_pathname("$medium->{url}/$medium->{with_hdlist}/../$local_pubkey"), reduce_pathname("$medium->{url}/pubkey"), @@ -1992,7 +1994,7 @@ this could happen if you mounted manually the directory when creating the medium } $options{nolock} or $urpm->unlock_urpmi_db; - $options{nopubkey} or $urpm->unlock_rpm_db; + $nopubkey or $urpm->unlock_rpm_db; } #- clean params and depslist computation zone. diff --git a/urpm/cfg.pm b/urpm/cfg.pm index 33ce8c2d..5baffc60 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -170,6 +170,7 @@ sub load_config ($;$) { |keep |auto |strict-arch + |nopubkey |resume)(?:\s*:\s*(.*))?$/x ) { my $yes = $no ? 0 : 1; -- cgit v1.2.1