summaryrefslogtreecommitdiffstats
path: root/urpmi.addmedia
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-21 10:37:03 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-21 10:37:03 +0000
commit6ed92702112c76f41ab8725f15ae101b3f9033ed (patch)
treedfbb690cf416912cbf3188072a73c9106b684848 /urpmi.addmedia
parentd7673c40f27c83f90e3ca5dbdd2fbd80f9c1eff2 (diff)
downloadurpmi-6ed92702112c76f41ab8725f15ae101b3f9033ed.tar
urpmi-6ed92702112c76f41ab8725f15ae101b3f9033ed.tar.gz
urpmi-6ed92702112c76f41ab8725f15ae101b3f9033ed.tar.bz2
urpmi-6ed92702112c76f41ab8725f15ae101b3f9033ed.tar.xz
urpmi-6ed92702112c76f41ab8725f15ae101b3f9033ed.zip
* 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'
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-xurpmi.addmedia10
1 files changed, 6 insertions, 4 deletions
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";