summaryrefslogtreecommitdiffstats
path: root/perl-install/commands.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-02-14 13:53:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-02-14 13:53:43 +0000
commitb665d3c80aa66b6f440ead49ac606e0702ffefd9 (patch)
treef9d2f8565a2aae01502b65760d91adf10c73a6fa /perl-install/commands.pm
parent625c6a2b2ad64ea930f2c444bed180b106732985 (diff)
downloaddrakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar.gz
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar.bz2
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar.xz
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.zip
no_comment
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r--perl-install/commands.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index bb3c6e04b..8fd032fa3 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -64,18 +64,20 @@ sub tr_ {
sub mount {
@_ or return cat("/proc/mounts");
- my ($t) = getopts(\@_, qw(t));
+ my ($t, $r) = getopts(\@_, qw(tr));
my $fs = $t && shift;
- @_ == 2 or die "usage: mount [-t <fs>] <device> <dir>\n",
+ @_ == 2 or die "usage: mount [-r] [-t <fs>] <device> <dir>\n",
" (if /dev/ is left off the device name, a temporary node will be created)\n";
my ($dev, $where) = @_;
$fs ||= $where =~ /:/ ? "nfs" :
$dev =~ /fd/ ? "vfat" : "ext2";
- require 'fs.pm';
- fs::mount($dev, $where, $fs, 0, 1);
+ require fs;
+ require modules;
+ modules::load_deps("/modules/modules.dep");
+ fs::mount($dev, $where, $fs, $r);
}
sub umount {
@@ -251,7 +253,10 @@ sub cp {
-d $dest or mkdir $dest, mode($src) or die "mkdir: can't create directory $dest: $!\n";
&$cp(glob_($src), $dest);
} elsif (-l $src) {
- symlink((readlink($src) || die "readlink failed: $!"), $dest) or die "symlink: can't create symlink $dest: $!\n";
+ unless (symlink((readlink($src) || die "readlink failed: $!"), $dest)) {
+ my $msg = "symlink: can't create symlink $dest: $!\n";
+ $force ? warn $msg : die $msg;
+ }
} else {
local (*F, *G);
open F, $src or die "can't open $src for reading: $!\n";