diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-04-17 15:42:29 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-04-17 15:42:29 +0000 |
commit | dddfb90059117e6dde52c09e79ba0c8672942b53 (patch) | |
tree | 351bfc56411ea5e33782e579e7291ed783023b4c /perl-install/devices.pm | |
parent | e2ab672b87d900beabb21632833e2f97d475b09a (diff) | |
download | drakx-backup-do-not-use-dddfb90059117e6dde52c09e79ba0c8672942b53.tar drakx-backup-do-not-use-dddfb90059117e6dde52c09e79ba0c8672942b53.tar.gz drakx-backup-do-not-use-dddfb90059117e6dde52c09e79ba0c8672942b53.tar.bz2 drakx-backup-do-not-use-dddfb90059117e6dde52c09e79ba0c8672942b53.tar.xz drakx-backup-do-not-use-dddfb90059117e6dde52c09e79ba0c8672942b53.zip |
no_comment
Diffstat (limited to 'perl-install/devices.pm')
-rw-r--r-- | perl-install/devices.pm | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm index c48bd3636..1a84d84ae 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -48,17 +48,9 @@ sub set_loop { } } -sub make($) { - local $_ = my $file = $_[0]; +sub entry { my ($type, $major, $minor); - - if (m,^(.*/(?:dev|tmp))/(.*),) { - $_ = $2; - } else { - -e $file or $file = "/tmp/$_"; - -e $file or $file = "/dev/$_"; - } - -e $file and return $file; #- assume nobody takes fun at creating files named as device + local ($_) = @_; if (/^sd(.)(\d{0,2})/) { $type = c::S_IFBLK(); @@ -122,6 +114,22 @@ sub make($) { "zero" => [ c::S_IFCHR(), 1, 5 ], }}{$_} or die "unknown device $_" }; } + ($type, $major, $minor); +} + + +sub make($) { + local $_ = my $file = $_[0]; + + if (m,^(.*/(?:dev|tmp))/(.*),) { + $_ = $2; + } else { + -e $file or $file = "/tmp/$_"; + -e $file or $file = "/dev/$_"; + } + -e $file and return $file; #- assume nobody takes fun at creating files named as device + + my ($type, $major, $minor) = entry($_); #- make a directory for this inode if needed. mkdir dirname($file), 0755; |