summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-02-05 10:46:45 +0000
committerFrancois Pons <fpons@mandriva.com>2001-02-05 10:46:45 +0000
commit5dd589c99385fa45a0b91cd540e9a2b47bee9be8 (patch)
treeebc1db427c0ce188b5189cb1d165cab6060ff8f9
parent81aa0f6ac2939aa1ddea1b1507e7ccd0632e76fa (diff)
downloadurpmi-5dd589c99385fa45a0b91cd540e9a2b47bee9be8.tar
urpmi-5dd589c99385fa45a0b91cd540e9a2b47bee9be8.tar.gz
urpmi-5dd589c99385fa45a0b91cd540e9a2b47bee9be8.tar.bz2
urpmi-5dd589c99385fa45a0b91cd540e9a2b47bee9be8.tar.xz
urpmi-5dd589c99385fa45a0b91cd540e9a2b47bee9be8.zip
*** empty log message ***
-rw-r--r--urpm.pm23
-rwxr-xr-xurpmi3
-rw-r--r--urpmi.spec6
3 files changed, 23 insertions, 9 deletions
diff --git a/urpm.pm b/urpm.pm
index 73bb2136..50f8f071 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -275,7 +275,7 @@ sub add_medium {
#- the directory given does not exist or may be accessible
#- by mounting some other. try to figure out these directory and
#- mount everything necessary.
- $urpm->try_mounting($dir, 'mount');
+ $urpm->try_mounting($dir, 'mount') or $urpm->{log}("unable to access medium \"$name\""), return;
#- check if directory is somewhat normalized so that we can get back hdlist,
#- check it that case if depslist, compss and provides file are also
@@ -394,7 +394,7 @@ sub update_media {
#- the directory given does not exist and may be accessible
#- by mounting some other. try to figure out these directory and
#- mount everything necessary.
- $urpm->try_mounting($dir, 'mount');
+ $urpm->try_mounting($dir, 'mount') or $urpm->{log}("unable to access medium \"$medium->{name}\""), next;
#- if the source hdlist is present and we are not forcing using rpms file
if (!$options{force} && $medium->{with_hdlist} && -e "$dir/$medium->{with_hdlist}") {
@@ -596,7 +596,7 @@ sub update_media {
sub try_mounting {
my ($urpm, $dir, $mode) = @_;
- if (!-e $dir) {
+ if ($mode eq 'mount' ? !-e $dir : -e $dir) {
my ($fdir, $pdir, $v, %fstab, @possible_mount_point) = $dir;
#- read /etc/fstab and check for existing mount point.
@@ -635,12 +635,13 @@ sub try_mounting {
}
#- try to mount or unmount according to mode.
- $mode eq 'unmount' and @possible_mount_point = reverse @possible_mount_point;
+ $mode ne 'mount' and @possible_mount_point = reverse @possible_mount_point;
foreach (@possible_mount_point) {
- $fstab{$_} == ($mode ne 'mount') and $fstab{$_} = ($mode eq 'mount'), `$mode '$_' 2>/dev/null`;
+ $fstab{$_} == ($mode ne 'mount') and $fstab{$_} = ($mode eq 'mount'),
+ $urpm->{log}("${mode}ing $_"), `$mode '$_' 2>/dev/null`;
}
}
- -e $dir;
+ $mode eq 'mount' ? -e $dir : !-e $dir;
}
#- read depslist file using rpmtools, this file is not managed directly by urpm.
@@ -1062,8 +1063,14 @@ sub upload_source_packages {
}
};
foreach (0..$#$list) {
- @{$list->[$_]} && $urpm->{media}[$_]{removable} or next;
- push @{$removables{$urpm->{media}[$_]{removable}} ||= []}, $_;
+ @{$list->[$_]} or next;
+ my $medium = $urpm->{media}[$_];
+ #- examine non removable device but that may be mounted.
+ if ($medium->{removable}) {
+ push @{$removables{$medium->{removable}} ||= []}, $_;
+ } elsif (my ($prefix, $dir) = $medium->{url} =~ /^(removable_[^:]*|file):\/(.*)/) {
+ -e $dir || $urpm->try_mounting($dir, 'mount') or $urpm->{error}("unable to access medium \"$medium->{name}\""), next;
+ }
}
foreach my $device (keys %removables) {
#- here we have only removable device.
diff --git a/urpmi b/urpmi
index 37b99494..de854b4b 100755
--- a/urpmi
+++ b/urpmi
@@ -187,6 +187,9 @@ my $something_was_installed;
install(@sources);
$something_was_installed or message_auto(_("everything already installed"));
+#- this help flushing correctly by closing this file before (piped on tee).
+close STDERR;
+close STDOUT;
sub install {
@_ or return;
diff --git a/urpmi.spec b/urpmi.spec
index d7e95342..45412794 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 1.4
-Release: 5mdk
+Release: 6mdk
License: GPL
Source0: %{name}.tar.bz2
Summary: User mode rpm install
@@ -113,6 +113,10 @@ autoirpm.uninstall
%changelog
+* Mon Feb 5 2001 François Pons <fpons@mandrakesoft.com> 1.4-6mdk
+- fixed missing mounting on non removable device like nfs.
+- flush STDERR and STDOUT before exiting.
+
* Tue Jan 30 2001 François Pons <fpons@mandrakesoft.com> 1.4-5mdk
- added medium change code.
- fixed urpmi with local file.