summaryrefslogtreecommitdiffstats
path: root/MDK/Common/File.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-06-25 07:43:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-06-25 07:43:28 +0000
commite2b6da2c1858c657ebd527fcf64e08bce41746cc (patch)
tree80c13a18c8401cc5602e6d424c7bf876e8281b5e /MDK/Common/File.pm
parentd5cad2f4c2d9c917a2dce1a563edf1537b26237d (diff)
downloadperl-MDK-Common-e2b6da2c1858c657ebd527fcf64e08bce41746cc.tar
perl-MDK-Common-e2b6da2c1858c657ebd527fcf64e08bce41746cc.tar.gz
perl-MDK-Common-e2b6da2c1858c657ebd527fcf64e08bce41746cc.tar.bz2
perl-MDK-Common-e2b6da2c1858c657ebd527fcf64e08bce41746cc.tar.xz
perl-MDK-Common-e2b6da2c1858c657ebd527fcf64e08bce41746cc.zip
fix cp_af() for symlinks to directories
Diffstat (limited to 'MDK/Common/File.pm')
-rw-r--r--MDK/Common/File.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/MDK/Common/File.pm b/MDK/Common/File.pm
index f73a99c..3e28689 100644
--- a/MDK/Common/File.pm
+++ b/MDK/Common/File.pm
@@ -174,13 +174,13 @@ sub cp_with_option {
unlink $dest;
- if (-d $src) {
- -d $dest or mkdir $dest, (stat($src))[2] or die "mkdir: can't create directory $dest: $!\n";
- cp_af(glob_($src), $dest);
- } elsif (-l $src && $keep_special) {
+ if (-l $src && $keep_special) {
unless (symlink(readlink($src) || die("readlink failed: $!"), $dest)) {
warn "symlink: can't create symlink $dest: $!\n";
}
+ } elsif (-d $src) {
+ -d $dest or mkdir $dest, (stat($src))[2] or die "mkdir: can't create directory $dest: $!\n";
+ cp_af(glob_($src), $dest);
} elsif ((-b $src || -c $src) && $keep_special) {
my @stat = stat($src);
require MDK::Common::System;