diff options
author | Francois Pons <fpons@mandriva.com> | 2002-07-16 14:08:22 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-07-16 14:08:22 +0000 |
commit | 2cdbfcaf36c3561381a440ca84f2579ce0092776 (patch) | |
tree | 784e1a0785b07933f55971ef98979eb7d0cac6ce | |
parent | a5e21163c70a7a63e1df62871af8a5facae20a0a (diff) | |
download | urpmi-2cdbfcaf36c3561381a440ca84f2579ce0092776.tar urpmi-2cdbfcaf36c3561381a440ca84f2579ce0092776.tar.gz urpmi-2cdbfcaf36c3561381a440ca84f2579ce0092776.tar.bz2 urpmi-2cdbfcaf36c3561381a440ca84f2579ce0092776.tar.xz urpmi-2cdbfcaf36c3561381a440ca84f2579ce0092776.zip |
3.7-5mdk
-rw-r--r-- | urpm.pm | 10 | ||||
-rwxr-xr-x | urpmi | 14 | ||||
-rwxr-xr-x | urpmi.addmedia | 10 | ||||
-rw-r--r-- | urpmi.spec | 8 | ||||
-rwxr-xr-x | urpmi.update | 12 |
5 files changed, 31 insertions, 23 deletions
@@ -132,11 +132,11 @@ sub new { sub get_proxy { my $proxy = { http_proxy => undef , + ftp_proxy => undef , user => undef, pwd => undef }; local (*F, $_); - # open F, "$ENV{HOME}/.wgetrc" or return; open F, "/etc/urpmi/proxy.cfg" or return undef; while (<F>) { chomp; s/#.*$//; s/^\s*//; s/\s*$//; @@ -621,7 +621,7 @@ sub add_distrib_media { eval { $urpm->{log}(_("retrieving hdlists file...")); # $urpm->{sync}({proxy => $urpm->{proxy}}, "$urpm->{cachedir}/partial", reduce_pathname("$url/Mandrake/base/hdlists")); - $urpm->{sync}({dir => "$urpm->{cachedir}/partial", quiet => 1, proxy => $urpm->{proxy}}, reduce_pathname("$url/Mandrake/base/hdlists")); + $urpm->{sync}({dir => "$urpm->{cachedir}/partial", quiet => 0, proxy => $urpm->{proxy}}, reduce_pathname("$url/Mandrake/base/hdlists")); $urpm->{log}(_("...retrieving done")); }; $@ and $urpm->{log}(_("...retrieving failed: %s", $@)); @@ -966,8 +966,7 @@ sub update_media { system("cp", "-a", "$urpm->{statedir}/$medium->{hdlist}", "$urpm->{cachedir}/partial/$basename"); } eval { -# $urpm->{sync}({proxy => $urpm->{proxy}}, "$urpm->{cachedir}/partial", reduce_pathname("$medium->{url}/$medium->{with_hdlist}")); - $urpm->{sync}({ dir => "$urpm->{cachedir}/partial", quiet => 1, proxy => $urpm->{proxy}}, reduce_pathname("$medium->{url}/$medium->{with_hdlist}")); + $urpm->{sync}({ dir => "$urpm->{cachedir}/partial", quiet => 0, proxy => $urpm->{proxy}}, reduce_pathname("$medium->{url}/$medium->{with_hdlist}")); }; if ($@) { $urpm->{log}(_("...retrieving failed: %s", $@)); @@ -1743,8 +1742,7 @@ sub download_source_packages { foreach (map { m|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)| ? "$1xxxx$2" : $_ } @distant_sources) { $urpm->{log}(" $_") ; } -# $urpm->{sync}({proxy => $urpm->{proxy}}, "$urpm->{cachedir}/rpms", @distant_sources); - $urpm->{sync}({dir => "$urpm->{cachedir}/rpms", quiet => 1, proxy => $urpm->{proxy}}, @distant_sources); + $urpm->{sync}({dir => "$urpm->{cachedir}/rpms", quiet => 0, proxy => $urpm->{proxy}}, @distant_sources); $urpm->{log}(_("...retrieving done")); }; $@ and $urpm->{log}(_("...retrieving failed: %s", $@)); @@ -94,7 +94,7 @@ usage: #- parse arguments list. my @nextargv; -for (@ARGV) { +while (defined($_ = shift @ARGV)) { /^--help$/ and do { usage; next }; /^--update$/ and do { $update = 1; next }; /^--media$/ and do { push @nextargv, \$media; next }; @@ -112,13 +112,15 @@ for (@ARGV) { urpm::sync_webfetch($options, @_) }; next }; /^--curl$/ and do { $sync = \&urpm::sync_webfetch; next }; /^--proxy$/ and do { - ($_ = shift @_) =~ m,^http://([^:]+)(:([\d]+)|[^:])$, or die $usage; - $_ .= ":1080" if /[^\d]/; - $urpm->{proxy}->{http_proxy} = $_; + my ($proxy, $port) = ($_ = shift @ARGV) =~ m,^(http://[^:]+(:\d+)?)/*$, or + die _("bad proxy declaration on command line\n"); + $proxy .= ":1080" unless $port; + $urpm->{proxy}{http_proxy} = $proxy; next; }; /^--proxy-user$/ and do { - ($_ = shift @_) =~ /(.+):(.+)/, or die $usage; + ($_ = shift @ARGV) =~ /(.+):(.+)/, or + die _("bad proxy declaration on command line\n"); $urpm->{proxy}->{user} = $1; $urpm->{proxy}->{pwd} = $2; next; @@ -368,7 +370,7 @@ if (%{$state->{ask_remove} || {}}) { my $list = join "\n", keys %{$state->{ask_remove}}; $noexpr = _("Nn"); $yesexpr = _("Yy"); - message_input(_("Some package have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ or + message_input(_("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ or system("rpm", "-e", "--nodeps", keys %{$state->{ask_remove}}, ($root ? ("--root", $root) : ())); } diff --git a/urpmi.addmedia b/urpmi.addmedia index 083b34f3..ba98bbdd 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -61,13 +61,15 @@ and [options] are from urpm::sync_webfetch($options, @_) }, next; /^--curl/ and $urpm->{sync} = \&urpm::sync_webfetch, next; /^--proxy$/ and do { - ($_ = shift @_) =~ m,^http://([^:]+)(:([\d]+)|[^:])$, or die $usage; - $_ .= ":1080" if /[^\d]/; - $urpm->{proxy}->{http_proxy} = $_; + my ($proxy, $port) = ($_ = shift @_) =~ m,^(http://[^:]+(:\d+)?)/*$, or + die _("bad proxy declaration on command line\n"); + $proxy .= ":1080" unless $port; + $urpm->{proxy}{http_proxy} = $proxy; next; }; /^--proxy-user$/ and do { - ($_ = shift @_) =~ /(.+):(.+)/, or die $usage; + ($_ = shift @_) =~ /(.+):(.+)/, or + die _("bad proxy declaration on command line\n"); $urpm->{proxy}->{user} = $1; $urpm->{proxy}->{pwd} = $2; next; @@ -2,13 +2,13 @@ Name: urpmi Version: 3.7 -Release: 4mdk +Release: 5mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate Summary: User mode rpm install Requires: eject webfetch perl-DateManip >= 5.40 -PreReq: perl-Locale-gettext rpmtools >= 4.3-2mdk perl-URPM >= 0.08-1mdk +PreReq: perl-Locale-gettext rpmtools >= 4.3-2mdk perl-URPM >= 0.10-1mdk BuildRequires: bzip2-devel gcc-c++ gettext rpm-devel rpmtools BuildRoot: %{_tmppath}/%{name}-buildroot BuildArch: noarch @@ -144,6 +144,10 @@ fi %changelog +* Tue Jul 16 2002 François Pons <fpons@mandrakesoft.com> 3.7-5mdk +- fixed no progression of download. +- fixed bad proxy support on command line. + * Fri Jul 12 2002 Pixel <pixel@mandrakesoft.com> 3.7-4mdk - fix problem with no proxy diff --git a/urpmi.update b/urpmi.update index 7560bd9c..4a516824 100755 --- a/urpmi.update +++ b/urpmi.update @@ -30,7 +30,7 @@ sub main { $options{force} = 0; $options{noclean} = 1; - foreach (@_) { + while ($_ = shift @_) { /^--?a/ and $options{all} = 1, next; /^--?c/ and $options{noclean} = 0, next; /^--?d/ and $options{depslist} = 1, next; @@ -41,13 +41,15 @@ sub main { urpm::sync_webfetch($options, @_) }, next; /^--curl/ and $urpm->{sync} = \&urpm::sync_webfetch, next; /^--proxy$/ and do { - ($_ = shift @_) =~ m,^http://([^:]+)(:([\d]+)|[^:])$, or die $usage; - $_ .= ":1080" if /[^\d]/; - $urpm->{proxy}->{http_proxy} = $_; + my ($proxy, $port) = ($_ = shift @_) =~ m,^(http://[^:]+(:\d+)?)/*$, or + die _("bad proxy declaration on command line\n"); + $proxy .= ":1080" unless $port; + $urpm->{proxy}{http_proxy} = $proxy; next; }; /^--proxy-user$/ and do { - ($_ = shift @_) =~ /(.+):(.+)/, or die $usage; + ($_ = shift @_) =~ /(.+):(.+)/, or + die _("bad proxy declaration on command line\n"); $urpm->{proxy}->{user} = $1; $urpm->{proxy}->{pwd} = $2; next; |