aboutsummaryrefslogtreecommitdiffstats
path: root/rpmdrake.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-10-05 06:39:40 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-10-05 06:39:40 +0000
commit295a08c8c3326669e64f500935d45c8d72e0462d (patch)
treefa4d23ffd0d3055d74511f289e6e5ef6ae5b6eb5 /rpmdrake.pm
parentdab2df82beaa06784e17f752ad5e614d1c6b6814 (diff)
downloadrpmdrake-295a08c8c3326669e64f500935d45c8d72e0462d.tar
rpmdrake-295a08c8c3326669e64f500935d45c8d72e0462d.tar.gz
rpmdrake-295a08c8c3326669e64f500935d45c8d72e0462d.tar.bz2
rpmdrake-295a08c8c3326669e64f500935d45c8d72e0462d.tar.xz
rpmdrake-295a08c8c3326669e64f500935d45c8d72e0462d.zip
Adaptation to the new update mirror architecture, for community, official
and cooker distributions. synthesis is now to be found in a media_info subdirectory, and RPMs in <version_number>/main_updates if the mirror url doesn't already end in media/main.
Diffstat (limited to 'rpmdrake.pm')
-rw-r--r--rpmdrake.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 933e56d4..bc8e696b 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -347,9 +347,10 @@ my %sites2countries = ('proxad.net' => 'fr',
sub distro_type {
- $mandrake_release =~ /community/i ? 'community'
- : $mandrake_release =~ /cooker/i ? 'cooker'
- : 'updates';
+ return 'cooker' if $mandrake_release =~ /cooker/i;
+ return 'updates' if $mandrake_release !~ /community/i;
+ (my $v) = split / /, cat_('/etc/version');
+ return $v =~ /\.0$/ ? 'community' : 'updates';
}
sub compat_arch_for_updates($) {
@@ -363,6 +364,7 @@ sub compat_arch_for_updates($) {
sub mirrors {
my ($cachedir) = @_;
my $distro_type = distro_type();
+ warn "distro_type=$distro_type\n";
$cachedir = '/root';
my $mirrorslist = "$cachedir/mirrorsfull.list";
unlink $mirrorslist;
@@ -453,13 +455,15 @@ by Mandrakelinux Official Updates.")), return '';
sub make_url_mirror {
my ($mirror) = @_;
- if ($mirror =~ m!/RPMS$!) {
+ if ($mirror =~ m!/(?:RPMS|media/main)\Z!) {
#- esp. for distro_type() =~ /cooker|community/
+ warn "m=$mirror/";
"$mirror/";
} else {
my ($class, $release) = $mandrake_release =~ /(\S+)\s+release\s+(\S+)/;
$class !~ /linux/i and $release = lc($class) . "/$release"; #- handle subdirectory for corporate/clustering/etc
- "$mirror/$release/RPMS/";
+ warn "m=$mirror/$release/main_updates/";
+ "$mirror/$release/main_updates/";
}
}