From 3721966b585ae1f4276d7ce0c0f3516ec914dea5 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 17 Jan 2005 17:10:01 +0000 Subject: Fix logic error in the function that computes distro type --- rpmdrake.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'rpmdrake.pm') diff --git a/rpmdrake.pm b/rpmdrake.pm index fe8fa838..2f72729c 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -381,12 +381,11 @@ my %sites2countries = ( #- 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 'updates' if $mandrake_release !~ /community/i; + return 'cooker' if $mandrake_release =~ /cooker/i; + return 'official' if $want_base_distro && $mandrake_release =~ /official/i; + return 'updates' if $mandrake_release !~ /community/i; (my $v) = split / /, cat_('/etc/version'); - return $v =~ /\.0$/ ? 'community' : ( - $want_base_distro ? 'official' : 'updates' - ); + return $v =~ /\.0$/ ? 'community' : 'updates'; } sub compat_arch_for_updates($) { @@ -520,7 +519,7 @@ by Mandrakelinux Official Updates.") sub make_url_mirror { my ($mirror) = @_; - if ($mirror =~ m!/(?:RPMS|media/main)\Z!) { + if ($mirror =~ m!/(?:RPMS|media/main)/?\Z!) { #- esp. for distro_type() =~ /cooker|community/ "$mirror/"; } else { @@ -532,7 +531,7 @@ sub make_url_mirror { sub make_url_mirror_dist { my ($mirror) = @_; - $mirror =~ s!/(?:RPMS|media/main)\Z!/!; + $mirror =~ s!/(?:RPMS|media/main)/?\Z!/!; $mirror; } -- cgit v1.2.1