summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-09-16 12:31:12 +0000
committerFrancois Pons <fpons@mandriva.com>2002-09-16 12:31:12 +0000
commitb3392d01fc2f69381fafd73eb8a82b24833b3aed (patch)
tree2d0621b4c63fd52526af6c03c591cd83c9f3295e
parentc0c183400da9a38b8a15489df019f03a82fd7f23 (diff)
downloadurpmi-b3392d01fc2f69381fafd73eb8a82b24833b3aed.tar
urpmi-b3392d01fc2f69381fafd73eb8a82b24833b3aed.tar.gz
urpmi-b3392d01fc2f69381fafd73eb8a82b24833b3aed.tar.bz2
urpmi-b3392d01fc2f69381fafd73eb8a82b24833b3aed.tar.xz
urpmi-b3392d01fc2f69381fafd73eb8a82b24833b3aed.zip
4.0-19mdk
-rw-r--r--urpm.pm24
-rwxr-xr-xurpmi2
-rw-r--r--urpmi.spec6
3 files changed, 25 insertions, 7 deletions
diff --git a/urpm.pm b/urpm.pm
index 877ca689..c6d6d88e 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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
diff --git a/urpmi b/urpmi
index ad190959..d67a4900 100755
--- a/urpmi
+++ b/urpmi
@@ -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.
diff --git a/urpmi.spec b/urpmi.spec
index 0faeb38d..5cb061a4 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -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.