From 6712b020a073f2a6358cafc3dc30a4edfb0da3c6 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 28 Feb 2006 17:54:18 +0000 Subject: Fix for mirror and version-guessing heuristic (bug #21307) by Blino --- rpmdrake.pm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'rpmdrake.pm') diff --git a/rpmdrake.pm b/rpmdrake.pm index 74e05865..b471de08 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -448,15 +448,24 @@ my %sites2countries = ( 'averse.net' => 'sg', ); +#- get distrib release number (2006.0, etc) +sub etc_version { + (my $v) = split / /, cat_('/etc/version'); + return $v; +} + #- returns the keyword describing the type of the distribution. #- the parameter indicates whether we want base or update sources sub distro_type { my ($want_base_distro) = @_; - return 'cooker' if $mandrake_release =~ /cooker/i; - return 'official' if $want_base_distro && $mandrake_release =~ /official|limited/i; - return 'updates' if $mandrake_release !~ /community/i; - (my $v) = split / /, cat_('/etc/version'); - return $v =~ /\.0$/ ? 'community' : 'updates'; + return 'cooker' if $mandrake_release =~ /cooker/i; + #- we can't use updates for community while official is not out (release ends in ".0") + if ($want_base_distro || ($mandrake_release =~ /community/i && etc_version() =~ /\.0$/)) { + return 'official' if $mandrake_release =~ /official|limited/i; + return 'community' if $mandrake_release =~ /community/i; + #- unknown: fallback to updates + } + return 'updates'; } sub compat_arch_for_updates($) { -- cgit v1.2.1