summaryrefslogtreecommitdiffstats
path: root/perl-install/devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-08-13 14:36:52 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-08-13 14:36:52 +0000
commit643921ac883be8af9dad01e441028d3564aea565 (patch)
tree0e72b712472030c8522ef0606147e4e8968cc8a5 /perl-install/devices.pm
parente03f94cb575827ae939c90132604ee5af8545b7a (diff)
downloaddrakx-643921ac883be8af9dad01e441028d3564aea565.tar
drakx-643921ac883be8af9dad01e441028d3564aea565.tar.gz
drakx-643921ac883be8af9dad01e441028d3564aea565.tar.bz2
drakx-643921ac883be8af9dad01e441028d3564aea565.tar.xz
drakx-643921ac883be8af9dad01e441028d3564aea565.zip
no_comment
Diffstat (limited to 'perl-install/devices.pm')
-rw-r--r--perl-install/devices.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index ac72bc3ed..7932eb21b 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -38,13 +38,16 @@ sub size($) {
sub make($) {
local $_ = my $file = $_[0];
my ($type, $major, $minor);
- my ($prefix);
+ my $prefix = '';
- unless (s,^(.*)/(dev|tmp)/,,) {
+ if (m,^(.*)/(dev|tmp)/(.*),) {
$prefix = $1;
- $file = -e "$prefix/dev/$file" ? "$prefix/dev/$file" : "$prefix/tmp/$file";
+ $_ = $3;
+ } elsif (m,/,) {
+ die "can't make device $file";
}
-
+ $file = "$prefix/dev/$_";
+ -e $file or $file = "$prefix/tmp/$_";
-e $file and return $file; # assume nobody takes fun at creating files named as device
if (/^sd(.)(\d{0,2})/) {