From b7154b6a7d3cc6b7465c405f93bbb596be79985f Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 20 Aug 2003 18:48:13 +0000 Subject: added pubkey support for medium. --- perl-install/pkgs.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index ca138095f..4756e3d26 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -392,6 +392,7 @@ sub psUsingHdlist { fakemedium => $fakemedium, selected => $selected, #- default value is only CD1, it is really the minimal. ignored => !$selected, #- keep track of ignored medium by DrakX. + pubkey => [], #- all pubkey block here }; #- copy hdlist file directly to urpmi directory, this will be used @@ -411,6 +412,25 @@ sub psUsingHdlist { -s $newsf > 0 or unlink $newsf; } + #- get all keys corresponding in the right pubkey file, + #- they will be added in rpmdb later if not found. + my $pubkey = install_any::getFile("Mandrake/base/pubkey" . ($hdlist =~ /hdlist(\S*)\.cz2?/ && $1)); + my ($block, $content); + foreach (<$pubkey>) { + my $inside_block = /^-----BEGIN PGP PUBLIC KEY BLOCK-----$/ ... /^-----END PGP PUBLIC KEY BLOCK-----$/; + if ($inside_block) { + $block .= $_; + if ($inside_block =~ /E/) { + push @{$m->{pubkey}}, { block => $block, content => $content }; + $block = $content = ''; + } + #- now compute content (for finding the right key). + chomp; + my $inside_content = /^$/ ... /^-----END PGP PUBLIC KEY BLOCK-----$/; + $inside_content > 1 and $content .= $_; + } + } + #- integrate medium in media list, only here to avoid download error (update) to be propagated. $packages->{mediums}{$medium} = $m; -- cgit v1.2.1