diff options
-rw-r--r-- | urpm.pm | 24 | ||||
-rwxr-xr-x | urpmi | 2 | ||||
-rw-r--r-- | urpmi.spec | 6 |
3 files changed, 25 insertions, 7 deletions
@@ -160,7 +160,9 @@ sub set_proxy { for ($proxy->{type}) { /wget/ && do { for ($proxy->{proxy}) { - $ENV{http_proxy} = $_->{http_proxy} if defined $_->{http_proxy}; + if (defined $_->{http_proxy}) { + $ENV{http_proxy} = $_->{http_proxy} =~ /^http:\/\// ? $_->{http_proxy} : "http://$_->{http_proxy}"; + } $ENV{ftp_proxy} = $_->{ftp_proxy} if defined $_->{ftp_proxy}; @res = ("--proxy-user=$_->{user}", "--proxy-passwd=$_->{pwd}") if defined $_->{user} && defined $_->{pwd}; } @@ -1463,12 +1465,13 @@ sub reduce_pathname { #- check for necessity of mounting some directory to get access sub try_mounting { - my ($urpm, $dir) = @_; + my ($urpm, $dir, $removable) = @_; $dir = reduce_pathname($dir); foreach ($urpm->find_mntpoints($dir, 'mount')) { $urpm->{log}(_("mounting %s", $_)); `mount '$_' 2>/dev/null`; + $removable and $urpm->{removable_mounted}{$_} = undef; } -e $dir; } @@ -1480,10 +1483,19 @@ sub try_umounting { foreach ($urpm->find_mntpoints($dir, 'umount')) { $urpm->{log}(_("unmounting %s", $_)); `umount '$_' 2>/dev/null`; + delete $urpm->{removable_mounted}{$_}; } ! -e $dir; } +sub try_umounting_removables { + my ($urpm) = @_; + foreach (keys %{$urpm->{removable_mounted}}) { + $urpm->try_umounting($_); + } + delete $urpm->{removable_mounted}; +} + #- relocate depslist array id to use only the most recent packages, #- reorder info hashes to give only access to best packages. sub relocate_depslist_provides { @@ -1807,14 +1819,14 @@ sub download_source_packages { #- examine if given medium is already inside a removable device. my $check_notfound = sub { - my ($id, $dir) = @_; - $dir and $urpm->try_mounting($dir); + my ($id, $dir, $removable) = @_; + $dir and $urpm->try_mounting($dir, $removable); if (!$dir || -e $dir) { foreach (values %{$list->[$id]}) { /^(removable_?[^_:]*|file):\/(.*\/([^\/]*))/ or next; unless ($dir) { $dir = $2; - $urpm->try_mounting($dir); + $urpm->try_mounting($dir, $removable); } -r $2 or return 1; } @@ -1833,7 +1845,7 @@ sub download_source_packages { #- the directory given does not exist or may be accessible #- by mounting some other. try to figure out these directory and #- mount everything necessary. - while ($check_notfound->($id, $dir)) { + while ($check_notfound->($id, $dir, 'removable')) { $ask_for_medium or $urpm->{fatal}(4, _("medium \"%s\" is not selected", $medium->{name})); $urpm->try_umounting($dir); system("eject", $device); $ask_for_medium->($medium->{name}, $medium->{removable}) or @@ -567,6 +567,8 @@ if (%sources_install || %sources) { } else { message(_("everything already installed"), $auto); } +#- try to umount removable device which may have been mounted. +$urpm->try_umounting_removables; #- this help flushing correctly by closing this file before (piped on tee). #- but killing them is generally better. @@ -2,7 +2,7 @@ Name: urpmi Version: 4.0 -Release: 18mdk +Release: 19mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -202,6 +202,10 @@ fi %changelog +* Mon Sep 16 2002 François Pons <fpons@mandrakesoft.com> 4.0-19mdk +- fixed possible problem with http proxy for wget. +- umount removable device automatically mounted. + * Fri Sep 13 2002 François Pons <fpons@mandrakesoft.com> 4.0-18mdk - removed apache2-conf from skip.list as it doesn't work when trying to install apache2. |