diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-06-25 09:42:32 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-06-25 09:42:32 +0000 |
commit | 720c384fd2ed6df516ceb5284aaac1bf785c3c94 (patch) | |
tree | 99a94cb24aeaa37b94dab3d80c0bc17e8200aead | |
parent | a0d6dc498b1d74c986c8ae143d9dd663b0b61d67 (diff) | |
download | urpmi-720c384fd2ed6df516ceb5284aaac1bf785c3c94.tar urpmi-720c384fd2ed6df516ceb5284aaac1bf785c3c94.tar.gz urpmi-720c384fd2ed6df516ceb5284aaac1bf785c3c94.tar.bz2 urpmi-720c384fd2ed6df516ceb5284aaac1bf785c3c94.tar.xz urpmi-720c384fd2ed6df516ceb5284aaac1bf785c3c94.zip |
Make the verify-rpm being settable per-media in urpmi.cfg
-rw-r--r-- | urpm.pm | 25 | ||||
-rwxr-xr-x | urpmi | 2 |
2 files changed, 18 insertions, 9 deletions
@@ -119,7 +119,7 @@ sub read_config { #- per-media options for my $m (grep { $_ ne '' } keys %$config) { my $medium = { name => $m, clear_url => $config->{$m}{url} }; - for my $opt (qw(hdlist list with_hdlist removable md5sum key-ids update ignore synthesis virtual)) { + for my $opt (qw(hdlist list with_hdlist removable md5sum key-ids update ignore synthesis virtual verify-rpm)) { defined $config->{$m}{$opt} and $medium->{$opt} = $config->{$m}{$opt}; } $urpm->probe_medium($medium, %options) and push @{$urpm->{media}}, $medium; @@ -2913,18 +2913,23 @@ sub check_sources_signatures { if ($verif =~ /NOT OK/) { $invalid_sources{$filepath} = N("Invalid signature (%s)", $verif); } else { - #print "+++$medium->{name}:$medium->{start}:$medium->{end}:$id\n"; unless ($medium && - defined $medium->{start} && $medium->{start} <= $id && - defined $medium->{end} && $id <= $medium->{end}) { + defined $medium->{start} && $medium->{start} <= $id && + defined $medium->{end} && $id <= $medium->{end}) + { $medium = undef; foreach (@{$urpm->{media}}) { - defined $_->{start} && $_->{start} <= $id && defined $_->{end} && $id <= $_->{end} and $medium = $_, last; + defined $_->{start} && $_->{start} <= $id + && defined $_->{end} && $id <= $_->{end} + and $medium = $_, last; } } + #- check whether verify-rpm is specifically disabled for this medium + $medium && defined $medium->{'verify-rpm'} && !$medium->{'verify-rpm'} + and next; my $key_ids = $medium && $medium->{'key-ids'} || $urpm->{options}{'key-ids'}; - #- check the key ids of the medium are matching (all) the given key id of the package. + #- check that the key ids of the medium match the key ids of the package. if ($key_ids) { my $valid_ids = 0; my $invalid_ids = 0; @@ -2944,8 +2949,12 @@ sub check_sources_signatures { } } #- invoke check signature callback. - $options{callback} and $options{callback}->($urpm, $filepath, %options, - id => $id, verif => $verif, why => $invalid_sources{$filepath}); + $options{callback} and $options{callback}->( + $urpm, $filepath, %options, + id => $id, + verif => $verif, + why => $invalid_sources{$filepath}, + ); } } @@ -617,7 +617,7 @@ foreach my $set (@{$state->{transaction} || []}) { ); my %transaction_sources_install = %{$urpm->extract_packages_to_install(\%transaction_sources) || {}}; - if ($urpm->{options}{'verify-rpm'} && !$force) { + if (!$force && ($urpm->{options}{'verify-rpm'}) || grep { $_->{'verify-rpm'} } @{$urpm->{media}}) { my @bad_signatures = $urpm->check_sources_signatures(\%transaction_sources_install, \%transaction_sources, translate => 1); if (@bad_signatures) { |