summaryrefslogtreecommitdiffstats
path: root/perl-install/crypto.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-02-27 16:49:40 +0000
committerFrancois Pons <fpons@mandriva.com>2002-02-27 16:49:40 +0000
commit94742c2d89a0e4fb462bb95660dbc3e42aa3fc11 (patch)
tree29c0682c81ff08319f5f81af3ecad1737987e279 /perl-install/crypto.pm
parent11d5d7345a4b09f60ab5d11183fcc9dcbde86572 (diff)
downloaddrakx-94742c2d89a0e4fb462bb95660dbc3e42aa3fc11.tar
drakx-94742c2d89a0e4fb462bb95660dbc3e42aa3fc11.tar.gz
drakx-94742c2d89a0e4fb462bb95660dbc3e42aa3fc11.tar.bz2
drakx-94742c2d89a0e4fb462bb95660dbc3e42aa3fc11.tar.xz
drakx-94742c2d89a0e4fb462bb95660dbc3e42aa3fc11.zip
fix missing version listed when doing update.
Diffstat (limited to 'perl-install/crypto.pm')
-rw-r--r--perl-install/crypto.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm
index 27f1914b7..14ea7e126 100644
--- a/perl-install/crypto.pm
+++ b/perl-install/crypto.pm
@@ -104,7 +104,14 @@ sub bestMirror {
$possible[rand @possible];
}
-sub dir { $mirrors{$_[0]}[1] . '/' . $::VERSION }
+#- hack to retrieve Mandrake Linux version...
+sub version {
+ require pkgs;
+ my $pkg = pkgs::packageByName($::o->{packages}, 'mandrake-release');
+ $pkg && pkgs::packageVersion($pkg) || '8.2'; #- safe but dangerous ;-)
+}
+
+sub dir { $mirrors{$_[0]}[1] . '/' . version() }
sub ftp($) { ftp::new($_[0], dir($_[0])) }
sub getFile {
@@ -131,7 +138,7 @@ sub getPackages {
#- extract hdlist of crypto, then depslist.
require pkgs;
my $update_medium = pkgs::psUsingHdlist($prefix, 'ftp', $packages, "hdlist-updates.cz", "1u", "RPMS",
- "Updates for Mandrake Linux $::VERSION", 1, getFile("base/hdlist.cz", $mirror)) and
+ "Updates for Mandrake Linux " . version(), 1, getFile("base/hdlist.cz", $mirror)) and
log::l("read updates hdlist");
#- keep in mind where is the URL prefix used according to mirror (for install_any::install_urpmi).
$update_medium->{prefix} = "ftp://$mirror" . dir($mirror);