diff options
-rw-r--r-- | urpm.pm | 18 | ||||
-rwxr-xr-x | urpmi.addmedia | 5 | ||||
-rw-r--r-- | urpmi.spec | 6 |
3 files changed, 21 insertions, 8 deletions
@@ -225,7 +225,7 @@ sub sync_wget { my $options = shift @_; system "/usr/bin/wget", (ref $options && set_proxy({type => "wget", proxy => $options->{proxy}})), - (ref $options && $options->{quiet} ? ("-q") : ()), "-NP", + (ref $options && $options->{quiet} ? ("-q") : ("-nv")), "-NP", (ref $options ? $options->{dir} : $options), @_; $? == 0 or die _("wget failed: exited with %d or signal %d\n", $? >> 8, $? & 127); } @@ -672,8 +672,20 @@ sub add_medium { #- if a medium with that name has already been found #- we have to exit now my ($medium); - foreach (@{$urpm->{media}}) { - $_->{name} eq $name and $medium = $_; + if (defined $options{index_name}) { + my $i = $options{index_name}; + do { + ++$i; + undef $medium; + foreach (@{$urpm->{media}}) { + $_->{name} eq $name.$i and $medium = $_; + } + } while ($medium); + $name .= $i; + } else { + foreach (@{$urpm->{media}}) { + $_->{name} eq $name and $medium = $_; + } } $medium and $urpm->{fatal}(5, _("medium \"%s\" already exists", $medium->{name})); diff --git a/urpmi.addmedia b/urpmi.addmedia index 7569c745..29d1aba8 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -151,11 +151,9 @@ and [options] are from #- examine its contents and create all requested media, url is now a simple regex. 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+(.*))?$/) { @@ -176,8 +174,7 @@ and [options] are from } #- sort according to url or location if possible. !$url || $l && $l =~ /$url/i || $burl =~ /$url/i or next; - $urpm->add_medium("$name$i", $burl, $relative_hdlist, update => $options{update}); - ++$i; + $urpm->add_medium($name, $burl, $relative_hdlist, update => $options{update}, index_name => 0); } close F; } else { @@ -2,7 +2,7 @@ Name: urpmi Version: 4.1 -Release: 9mdk +Release: 10mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -204,6 +204,10 @@ fi %changelog +* Fri Dec 6 2002 François Pons <fpons@mandrakesoft.com> 4.1-10mdk +- fixed indexation when using --distrib-XXX for urpmi.addmedia. +- fixed wget output to be far more quietly. + * Fri Dec 6 2002 François Pons <fpons@mandrakesoft.com> 4.1-9mdk - improved urpmf from sh to perl, now a lot of options and support of synthesis only media. |