mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Merge pull request #1548 from webmin/copy-source-dir-symlink
Fix to copy links first, no matter if dir or file
This commit is contained in:
@@ -7078,6 +7078,12 @@ if ($gconfig{'os_type'} eq 'windows') {
|
||||
$err = $out;
|
||||
}
|
||||
}
|
||||
elsif (-l $src && !$copylink) {
|
||||
# A link .. re-create
|
||||
my $linkdst = readlink($src);
|
||||
$ok = &symlink_logged($linkdst, $dst);
|
||||
$err = $ok ? undef : $!;
|
||||
}
|
||||
elsif (-d $src) {
|
||||
# A directory .. need to copy with tar command
|
||||
my @st = stat($src);
|
||||
@@ -7090,12 +7096,6 @@ elsif (-d $src) {
|
||||
$err = $out;
|
||||
}
|
||||
}
|
||||
elsif (-l $src && !$copylink) {
|
||||
# A link .. re-create
|
||||
my $linkdst = readlink($src);
|
||||
$ok = &symlink_logged($linkdst, $dst);
|
||||
$err = $ok ? undef : $!;
|
||||
}
|
||||
else {
|
||||
# Can just copy with cp
|
||||
my $out = &backquote_logged("cp -p ".quotemeta($src).
|
||||
|
||||
Reference in New Issue
Block a user