From 6ed92702112c76f41ab8725f15ae101b3f9033ed Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 21 Sep 2000 10:37:03 +0000 Subject: * urpmi.addmedia: try to mount the directory if file contains /mnt, mainly for /mnt/nfs (it can't hurt) * urpmi.addmedia (update): no args now means '-a' --- urpmi.addmedia | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'urpmi.addmedia') diff --git a/urpmi.addmedia b/urpmi.addmedia index 1561c19e..3fa058a8 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -30,10 +30,9 @@ if ($0 =~ /removemedia/) { system("urpmi.update"); exit 0; } elsif ($0 =~ /update/) { - if (local ($_) = @ARGV) { - my $regexp = /^--?a/ ? '[^#]\S*' : join('|', @ARGV); - system("urpmi.addmedia --noupdate $_") foreach grep { /^$regexp\s/ } `cat $CFG`; - } + my $regexp = !@ARGV || $ARGV[0] =~ /^--?a/ ? '[^#]\S*' : join('|', @ARGV); + system("urpmi.addmedia --noupdate $_") foreach grep { /^$regexp\s/ } `cat $CFG`; + my @hdlists = glob("$DIR/hdlist.*"); if (@hdlists) { system("genbasefiles $DIR ". join (' ', @hdlists)); @@ -86,6 +85,9 @@ my $RPMLIST = "$DIR/list.$name"; !-e $HDLIST || unlink $HDLIST or die "can't remove $HDLIST"; if (my ($prefix, $dir) = $url =~ m,^(removable_.*?|file):/(.*),) { + if (!-e $dir && $dir =~ m|^(/mnt/.*?)|) { + $try2mount{$1} or $try2mount{$1} = 1, `mount $1 2>/dev/null`; + } my $f; if ($dir =~ /RPMS(.*)$/) { $f = "$dir/Mandrake/base/hdlist$1.$EXT"; -- cgit v1.2.1