summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-08-20 18:48:13 +0000
committerFrancois Pons <fpons@mandriva.com>2003-08-20 18:48:13 +0000
commitb7154b6a7d3cc6b7465c405f93bbb596be79985f (patch)
tree6300990b8c0a661b85fb575e7a0a9b2689415ccd /perl-install/pkgs.pm
parent3ad5c00eaf302d2086f261e96a5ca5e619e3e42d (diff)
downloaddrakx-backup-do-not-use-b7154b6a7d3cc6b7465c405f93bbb596be79985f.tar
drakx-backup-do-not-use-b7154b6a7d3cc6b7465c405f93bbb596be79985f.tar.gz
drakx-backup-do-not-use-b7154b6a7d3cc6b7465c405f93bbb596be79985f.tar.bz2
drakx-backup-do-not-use-b7154b6a7d3cc6b7465c405f93bbb596be79985f.tar.xz
drakx-backup-do-not-use-b7154b6a7d3cc6b7465c405f93bbb596be79985f.zip
added pubkey support for medium.
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm20
1 files changed, 20 insertions, 0 deletions
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;