diff options
author | Mystery Man <unknown@mandriva.org> | 2005-10-20 14:05:54 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-10-20 14:05:54 +0000 |
commit | 9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5 (patch) | |
tree | f3ef7ada2ce82dafb6d41cc087b0cc7fdfc40a46 /perl-install/crypto.pm | |
parent | 3e4ad5e1b687f262a1d7cc39a0b905a595ac7f95 (diff) | |
download | drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar.gz drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar.bz2 drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.tar.xz drakx-backup-do-not-use-10736c53ca91aed19de81858bf3358c6b2c9ab13.zip |
This commit was manufactured by cvs2svn to create tagV10_34_11_100mdk
'V10_34_11_100mdk'.
Diffstat (limited to 'perl-install/crypto.pm')
-rw-r--r-- | perl-install/crypto.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm index 7cd0b2447..830c908cd 100644 --- a/perl-install/crypto.pm +++ b/perl-install/crypto.pm @@ -44,6 +44,14 @@ use ftp; %mirrors = (); +sub compat_arch_for_updates($) { + # FIXME: We prefer 64-bit packages to update on biarch platforms, + # since the system is populated with 64-bit packages anyway. + my ($arch) = @_; + return $arch =~ /x86_64|amd64/ if (arch() eq 'x86_64'); + MDK::Common::System::compat_arch($arch); +} + sub mirror2text { $mirrors{$_[0]} && $mirrors{$_[0]}[0] . '|' . $_[0] } sub mirrors { my ($o_distro_type) = @_; @@ -60,7 +68,7 @@ sub mirrors { my $sub_dir = $distro_type =~ /cooker|community/ ? '' : ($::corporate ? '/corporate' : '') . '/' . version(); foreach (<$f>) { my ($arch, $url, $dir) = m|$distro_type([^:]*):ftp://([^/]*)(/\S*)| or next; - MDK::Common::System::compat_arch($arch) or + compat_arch_for_updates($arch) or log::l("ignoring updates from $url because of incompatible arch: $arch"), next; my $land = N("United States"); foreach (keys %url2land) { @@ -104,11 +112,12 @@ sub bestMirror { #- hack to retrieve Mandrakelinux version... sub version() { - require pkgs; - my $pkg = pkgs::packageByName($::o->{packages}, 'mandrake-release'); - $pkg && $pkg->version || '9.1'; #- safe but dangerous ;-) + my $release = cat_("$::prefix/etc/mandrake-release"); + my ($version) = $release =~ /Mandrake\s*linux.*\srelease\s+([\d.]+)/i; + $version || '10.0'; #- safe but dangerous ;-) } + sub dir { $mirrors{$_[0]}[1] } sub ftp($) { ftp::new($_[0], dir($_[0])) } |