aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-02-28 17:54:18 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-02-28 17:54:18 +0000
commit6712b020a073f2a6358cafc3dc30a4edfb0da3c6 (patch)
treee3d682e0646973bca4bbe82127b4da228869ebb5
parent721b0248e4154cc474c9b1d2fbb2c0e8c83af6f0 (diff)
downloadrpmdrake-6712b020a073f2a6358cafc3dc30a4edfb0da3c6.tar
rpmdrake-6712b020a073f2a6358cafc3dc30a4edfb0da3c6.tar.gz
rpmdrake-6712b020a073f2a6358cafc3dc30a4edfb0da3c6.tar.bz2
rpmdrake-6712b020a073f2a6358cafc3dc30a4edfb0da3c6.tar.xz
rpmdrake-6712b020a073f2a6358cafc3dc30a4edfb0da3c6.zip
Fix for mirror and version-guessing heuristic (bug #21307) by Blino
-rw-r--r--rpmdrake.pm19
1 files changed, 14 insertions, 5 deletions
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($) {