diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-09-16 18:35:07 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-09-16 18:35:07 +0000 |
commit | 8c7c8f9e1497f80cbe9bbdc1bf0b8552b7dd88cb (patch) | |
tree | 9521630ef9f9857cc3bb5c5ce606a958de4516cf /perl-install/commands.pm | |
parent | cf616f12521a0f539e4f02f70d0210beb0102320 (diff) | |
download | drakx-backup-do-not-use-8c7c8f9e1497f80cbe9bbdc1bf0b8552b7dd88cb.tar drakx-backup-do-not-use-8c7c8f9e1497f80cbe9bbdc1bf0b8552b7dd88cb.tar.gz drakx-backup-do-not-use-8c7c8f9e1497f80cbe9bbdc1bf0b8552b7dd88cb.tar.bz2 drakx-backup-do-not-use-8c7c8f9e1497f80cbe9bbdc1bf0b8552b7dd88cb.tar.xz drakx-backup-do-not-use-8c7c8f9e1497f80cbe9bbdc1bf0b8552b7dd88cb.zip |
use new mkdir_p, rm_rf and cp_af from MDK::Common
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r-- | perl-install/commands.pm | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm index 2a26b46dd..e378ab824 100644 --- a/perl-install/commands.pm +++ b/perl-install/commands.pm @@ -91,19 +91,7 @@ sub umount { sub mkdir_ { my ($rec) = getopts(\@_, qw(p)); - - my $mkdir; $mkdir = sub { - my $root = dirname $_[0]; - if (-e $root) { - -d $root or die "mkdir: error creating directory $_[0]: $root is a file and i won't delete it\n"; - } else { - $rec or die "mkdir: $root does not exist (try option -p)\n"; - &$mkdir($root); - } - $rec and -d $_[0] and return; - mkdir $_[0], 0755 or die "mkdir: error creating directory $_: $!\n"; - }; - &$mkdir($_) foreach @_; + mkdir_p($_) foreach @_; } @@ -406,7 +394,7 @@ sub unpack_ { print "$filename\n"; my $dir = dirname($filename); - -d $dir or mkdir_('-p', $dir); + -d $dir or mkdir_p($dir); local *G; open G, "> $filename" or die "can't write file $filename: $!\n"; |