summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 9904dac4742..e7aef738ec0 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1143,8 +1143,10 @@ sub copy {
}
if (-l "$infile") {
- symlink (readlink $infile, "$destdir/$filename")
- || die "symlink(readlink $infile, $destdir/$filename) failed: $!";
+ # the link target might be relative, so we need to start from
+ # the directory of $infile for the link
+ symlink (Cwd::abs_path(dirname($infile)) . "/" . readlink($infile), "$destdir/$filename")
+ || die "symlink(dirname($infile) . \"/\" . readlink($infile), $destdir/$filename) failed: $!";
} else {
if (! open (IN, $infile)) {
warn "open($infile) failed, not copying: $!";