texlive[52189] Master/tlpkg/TeXLive/TLUtils.pm: fix TLUtils::copy

commits+preining at tug.org commits+preining at tug.org
Fri Sep 27 02:31:10 CEST 2019


Revision: 52189
          http://tug.org/svn/texlive?view=revision&revision=52189
Author:   preining
Date:     2019-09-27 02:31:10 +0200 (Fri, 27 Sep 2019)
Log Message:
-----------
fix TLUtils::copy failure to deal with links properly

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLUtils.pm

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2019-09-26 23:55:07 UTC (rev 52188)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2019-09-27 00:31:10 UTC (rev 52189)
@@ -1143,8 +1143,10 @@
   }
 
   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: $!";



More information about the tex-live-commits mailing list