summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-27 06:38:05 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-27 06:38:05 +0000
commit7e3403527deaca8655dcc4c3befd6dbe53e33cbb (patch)
tree0c155f72e447ef7f7e0581126adf5a19f5c3fcbb
parent21b7551db1452f05322209b8f4d9c9064e8eefeb (diff)
downloadurpmi-7e3403527deaca8655dcc4c3befd6dbe53e33cbb.tar
urpmi-7e3403527deaca8655dcc4c3befd6dbe53e33cbb.tar.gz
urpmi-7e3403527deaca8655dcc4c3befd6dbe53e33cbb.tar.bz2
urpmi-7e3403527deaca8655dcc4c3befd6dbe53e33cbb.tar.xz
urpmi-7e3403527deaca8655dcc4c3befd6dbe53e33cbb.zip
Note that 10.1 updates are to be coded. Plus some cleanup.
-rwxr-xr-xurpmi.addmedia9
1 files changed, 5 insertions, 4 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia
index 7e93498a..66fc3c79 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -160,18 +160,19 @@ sub main {
#- examine its contents and create all requested media, url is now a simple regex.
my $heading = quotemeta($options{distrib});
my $qarch = quotemeta($options{arch});
- local *F;
- open F, "$urpm->{cachedir}/partial/$basename";
- while (<F>) {
+ open my $fh, "$urpm->{cachedir}/partial/$basename" or die $!;
+ while (<$fh>) {
chomp; s/#.*$//; s/^\s*//; s/\s*$//;
my ($v, $a, $l, $burl, $relative_hdlist);
if (($v, $a, $l, $burl, $relative_hdlist) = /^$heading:([^:]*):([^:]*):([^:]*):(\S*)(?:\s+with\s+(.*))?$/) {
$v eq '*' || $v eq $options{version} or next;
$a eq '*' || $a eq $options{arch} or next;
} elsif (($a, $burl) = /^$heading([^:]*):(\S*)$/) {
+ #- pre-10.1 architecture.
$a eq $options{arch} or next;
$options{distrib} eq 'updates' and $burl = "$burl/$options{version}/RPMS";
$options{distrib} eq 'contrib' and $burl .= "2";
+ #- TODO add for 10.1 updates
} elsif (($a, $burl) = /^cooker([^:]*):(\S*)$/) {
#- specific case for old style mirrors file description (of Mandrake).
$options{version} eq 'cooker' && $options{distrib} eq 'contrib' or next;
@@ -186,7 +187,7 @@ sub main {
$urpm->add_medium($name, $burl, $relative_hdlist,
virtual => $options{virtual}, update => $options{update}, index_name => 0);
}
- close F;
+ close $fh;
} else {
$with || $relative_hdlist
and usage N("no need to give <relative path of hdlist> with --distrib");