From 94742c2d89a0e4fb462bb95660dbc3e42aa3fc11 Mon Sep 17 00:00:00 2001
From: Francois Pons <fpons@mandriva.com>
Date: Wed, 27 Feb 2002 16:49:40 +0000
Subject: fix missing version listed when doing update.

---
 perl-install/crypto.pm | 11 +++++++++--
 1 file 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);
-- 
cgit v1.2.1