summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-10 11:24:43 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-10 11:24:43 +0000
commit50f7703a27e4ca409e999dcc2fdd156dc0adbc7b (patch)
tree3421935968a90dd9ad39c8be3bff1d0a5f793b15 /urpm.pm
parent9e314f55e66fcd0933b9391f0c6ce775ea583d18 (diff)
downloadurpmi-50f7703a27e4ca409e999dcc2fdd156dc0adbc7b.tar
urpmi-50f7703a27e4ca409e999dcc2fdd156dc0adbc7b.tar.gz
urpmi-50f7703a27e4ca409e999dcc2fdd156dc0adbc7b.tar.bz2
urpmi-50f7703a27e4ca409e999dcc2fdd156dc0adbc7b.tar.xz
urpmi-50f7703a27e4ca409e999dcc2fdd156dc0adbc7b.zip
Factorize the code that guesses the pubkey file name.
Use the rpm pubkey for the associated srpm media.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/urpm.pm b/urpm.pm
index 1adf1ecd..3379498c 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -914,6 +914,11 @@ sub _guess_hdlist_suffix {
$suffix;
}
+sub _guess_pubkey_name {
+ my ($medium) = @_;
+ return $medium->{with_hdlist} =~ /hdlist(.*?)(?:\.src)?\.cz2?$/ ? "pubkey$1" : 'pubkey';
+}
+
#- Update the urpmi database w.r.t. the current configuration.
#- Takes care of modifications, and tries some tricks to bypass
#- the recomputation of base files.
@@ -1297,8 +1302,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'}) {
- my $local_pubkey = $medium->{with_hdlist} =~ /hdlist(.*)\.cz2?$/ ? "pubkey$1" : 'pubkey';
- my $path_pubkey = reduce_pathname("$with_hdlist_dir/../$local_pubkey");
+ my $path_pubkey = reduce_pathname("$with_hdlist_dir/../" . _guess_pubkey_name($medium));
-e $path_pubkey or $path_pubkey = "$dir/pubkey";
if ($path_pubkey) {
urpm::util::copy($path_pubkey, "$urpm->{cachedir}/partial/pubkey")
@@ -1582,7 +1586,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'}) {
- my $local_pubkey = $medium->{with_hdlist} =~ /hdlist(.*)\.cz2?$/ ? "pubkey$1" : 'pubkey';
+ my $local_pubkey = _guess_pubkey_name($medium);
foreach (reduce_pathname("$medium->{url}/$medium->{with_hdlist}/../$local_pubkey"),
reduce_pathname("$medium->{url}/pubkey"),
) {