From 1db5d687d0039edeba825c650583f8f4fece6f2f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 28 Aug 2002 14:54:38 +0000 Subject: use mkdir_p instead of mkdir --- perl-install/detect_devices.pm | 2 +- perl-install/devices.pm | 2 +- perl-install/fs.pm | 4 ++-- perl-install/install_any.pm | 4 ++-- perl-install/loopback.pm | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index f7522f79c..e8b728b6e 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -610,7 +610,7 @@ sub probeSerialDevices { #- for device already probed, we can safely (assuming device are #- not moved during install :-) #- include /dev/mouse device if using an X server. - -d "/var/lock" or mkdir "/var/lock", 0755; + mkdir_p("/var/lock"); -l "/dev/mouse" and $serialprobe{"/dev/" . readlink "/dev/mouse"} = undef; foreach (keys %serialprobe) { m|^/dev/(.*)| and touch "/var/lock/LCK..$1" } diff --git a/perl-install/devices.pm b/perl-install/devices.pm index d9263eb52..7fd8a8990 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -175,7 +175,7 @@ sub make($) { } #- make a directory for this inode if needed. - mkdir dirname($file), 0755; + mkdir_p(dirname($file)); syscall_('mknod', $file, $type | 0600, makedev($major, $minor)) or die "mknod failed (dev $_): $!"; diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 4d94586cd..d1d6887d7 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -208,7 +208,7 @@ sub prepare_write_fstab { part2device($prefix, $_->{device}, $_->{type}); my $real_mntpoint = $_->{mntpoint} || ${{ '/tmp/hdimage' => '/mnt/hd' }}{$_->{real_mntpoint}}; - mkdir_p("$prefix$real_mntpoint", 0755) if $real_mntpoint =~ m|^/|; + mkdir_p("$prefix$real_mntpoint") if $real_mntpoint =~ m|^/|; my $mntpoint = loopback::carryRootLoopback($_) ? '/initrd/loopfs' : $real_mntpoint; my ($freq, $passno) = @@ -854,7 +854,7 @@ sub df { } elsif ($part->{notFormatted} && !$part->{isFormatted}) { return; #- won't even try! } else { - mkdir $dir; + mkdir_p($dir); eval { mount($part->{device}, $dir, type2fs($part), 'readonly') }; if ($@) { $part->{notFormatted} = 1; diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 85ce06463..05939b2a8 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -487,7 +487,7 @@ sub setAuthentication { } write_smb_conf($domain); run_program::rooted($o->{prefix}, "chkconfig", "--level", "35", "winbind", "on"); - mkdir "$o->{prefix}/home/$domain", 0755; + mkdir_p("$o->{prefix}/home/$domain"); #- defer running smbpassword - no network yet $winbind = $winbind . "%" . $winpass; @@ -779,7 +779,7 @@ sub getAndSaveAutoInstallFloppy { if (arch() =~ /sparc/) { my $imagefile = "$o->{prefix}/tmp/autoinst.img"; - my $mountdir = "$o->{prefix}/tmp/mount"; -d $mountdir or mkdir $mountdir, 0755; + my $mountdir = "$o->{prefix}/tmp/mount"; mkdir_p($mountdir); my $workdir = "$o->{prefix}/tmp/work"; -d $workdir or rmdir $workdir; getAndSaveInstallFloppy($o, $imagefile) or return; diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm index 817038e36..6129e6c6d 100644 --- a/perl-install/loopback.pm +++ b/perl-install/loopback.pm @@ -56,7 +56,7 @@ sub carryRootCreateSymlink { symlink "/initrd/loopfs/lnx4win/boot", "$prefix/boot"; } #- indicate kernel to keep initrd - mkdir "$prefix/initrd", 0755; + mkdir_p("$prefix/initrd"); } @@ -108,7 +108,7 @@ sub verifFile { sub prepare_boot { my $r = readlink "$::prefix/boot"; unlink "$::prefix/boot"; - mkdir "$::prefix/boot", 0755; + mkdir_p("$::prefix/boot"); [$r, $::prefix]; } -- cgit v1.2.1