summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-12-02 15:45:56 +0000
committerFrancois Pons <fpons@mandriva.com>2002-12-02 15:45:56 +0000
commitb2e54a124a9f0e2c5660acf8ddf5b0c53ef58436 (patch)
tree696a3a3d1f8446abf86acc5aa71c673b463eaa91
parent7133e5ec5350f3a79f5ea0ba25136e01837cec10 (diff)
downloadurpmi-b2e54a124a9f0e2c5660acf8ddf5b0c53ef58436.tar
urpmi-b2e54a124a9f0e2c5660acf8ddf5b0c53ef58436.tar.gz
urpmi-b2e54a124a9f0e2c5660acf8ddf5b0c53ef58436.tar.bz2
urpmi-b2e54a124a9f0e2c5660acf8ddf5b0c53ef58436.tar.xz
urpmi-b2e54a124a9f0e2c5660acf8ddf5b0c53ef58436.zip
4.1-6mdk
-rw-r--r--urpm.pm23
-rwxr-xr-xurpmi4
-rwxr-xr-xurpmi.addmedia10
-rw-r--r--urpmi.spec8
4 files changed, 30 insertions, 15 deletions
diff --git a/urpm.pm b/urpm.pm
index d4404bb5..26acd13a 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -375,9 +375,11 @@ sub read_config {
exists $hdlists{$_->{hdlist}} and
$_->{ignore} = 1, $urpm->{error}(_("medium \"%s\" trying to use an already used hdlist, medium ignored", $_->{name}));
$hdlists{$_->{hdlist}} = undef;
- exists $lists{$_->{list}} and
- $_->{ignore} = 1, $urpm->{error}(_("medium \"%s\" trying to use an already used list, medium ignored", $_->{name}));
- $lists{$_->{list}} = undef;
+ if ($_->{list}) {
+ exists $lists{$_->{list}} and
+ $_->{ignore} = 1, $urpm->{error}(_("medium \"%s\" trying to use an already used list, medium ignored", $_->{name}));
+ $lists{$_->{list}} = undef;
+ }
}
#- urpmi.cfg if old is not enough to known the various media, track
@@ -444,18 +446,16 @@ sub probe_medium {
$medium->{ignore} = 1, $urpm->{error}(_("unable to find hdlist file for \"%s\", medium ignored", $medium->{name}));
}
unless ($medium->{ignore} || $medium->{list}) {
- $medium->{list} = "list.$medium->{name}";
- unless (-e "$urpm->{statedir}/$medium->{list}") {
- if (defined $medium->{clear_url}) {
- delete $medium->{list};
- } else {
+ unless (defined $medium->{url}) {
+ $medium->{list} = "list.$medium->{name}";
+ unless (-e "$urpm->{statedir}/$medium->{list}") {
$medium->{ignore} = 1, $urpm->{error}(_("unable to find list file for \"%s\", medium ignored", $medium->{name}));
}
}
}
#- there is a little more to do at this point as url is not known, inspect directly list file for it.
- unless ($medium->{url} || $medium->{clear_url}) {
+ unless ($medium->{url}) {
my %probe;
local *L;
open L, "$urpm->{statedir}/$medium->{list}";
@@ -1268,6 +1268,7 @@ sub update_media {
} else {
#- the flag is no more necessary.
delete $medium->{list};
+ unlink "$urpm->{statedir}/$medium->{list}";
}
}
}
@@ -1291,7 +1292,7 @@ sub update_media {
#- but use newly created file.
unlink "$urpm->{statedir}/$medium->{hdlist}";
$medium->{synthesis} and unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}";
- unlink "$urpm->{statedir}/$medium->{list}";
+ $medium->{list} and unlink "$urpm->{statedir}/$medium->{list}";
unless ($medium->{headers}) {
rename("$urpm->{cachedir}/partial/$medium->{hdlist}", $medium->{synthesis} ?
"$urpm->{statedir}/synthesis.$medium->{hdlist}" : "$urpm->{statedir}/$medium->{hdlist}") or
@@ -1857,6 +1858,8 @@ sub get_source_packages {
my %sources;
unless ($medium->{ignore}) {
+ print STDERR ">>$medium->{$_}\n" foreach qw(name list url start end);
+ print STDERR "\n";
#- always prefer a list file is available.
if ($medium->{list} && -r "$urpm->{statedir}/$medium->{list}") {
open F, "$urpm->{statedir}/$medium->{list}";
diff --git a/urpmi b/urpmi
index bca47bce..18996a1c 100755
--- a/urpmi
+++ b/urpmi
@@ -445,8 +445,8 @@ unless ($local_sources || $list) {
$urpm->{fatal}(3, _("unable to get source packages, aborting"));
}
-my %sources = $urpm->download_source_packages($local_sources, $list, ($X ? '' : 'force_local'),
- (!$auto || $allow_medium_change) && sub {
+my %sources = $urpm->download_source_packages($local_sources, $list,
+ force_local => !$X, ask_for_medium => (!$auto || $allow_medium_change) && sub {
my $msg = _("Please insert the medium named \"%s\" on device [%s]", @_);
my $msg2 = _("Press Enter when ready...");
if ($X) {
diff --git a/urpmi.addmedia b/urpmi.addmedia
index 5355a877..dcc030e2 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -148,12 +148,13 @@ and [options] are from
};
$@ and $urpm->{log}(_("...retrieving failed: %s", $@));
#- examine its contents and create all requested media, url is now a simple regex.
- my $heading = quotemeta($options{version} eq 'cooker' ? 'cooker' : $options{distrib});
+ my $heading = quotemeta($options{distrib});
my $qarch = quotemeta($options{arch});
my $i = 1;
local *F;
open F, "$urpm->{cachedir}/partial/$basename";
while (<F>) {
+ print STDERR ">>>$_\n" if
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+(.*))?$/) {
@@ -162,7 +163,12 @@ and [options] are from
} elsif (($a, $burl) = /^$heading([^:]*):(\S*)$/) {
$a eq $options{arch} or next;
$options{distrib} eq 'updates' and $burl = "$burl/$options{version}/RPMS";
- $options{distrib} eq 'contrib' and $burl = $burl."2";
+ $options{distrib} eq 'contrib' and $burl .= "2";
+ } 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;
+ $a eq $options{arch} or next;
+ $burl .= "2";
} else {
# it could a blank line (from a commentary) or source description.
next;
diff --git a/urpmi.spec b/urpmi.spec
index 1d3a2990..df2d33b5 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 4.1
-Release: 5mdk
+Release: 6mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -204,6 +204,12 @@ fi
%changelog
+* Mon Dec 2 2002 François Pons <fpons@mandrakesoft.com> 4.1-6mdk
+- fixed mutliple second or more medium being ignored when not
+ using a list file.
+- fixed problem of package not found when not using list file.
+- fixed urpmi --auto.
+
* Fri Nov 29 2002 François Pons <fpons@mandrakesoft.com> 4.1-5mdk
- changed urpmi.addmedia behaviour to use /etc/urpmi/mirror.config
and allow it to parse urpmi.setup mirror configuration as