From c43e647c025ef593d9ada587d5f7a61d84381c14 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Wed, 18 Apr 2018 16:35:26 +0000 Subject: [PATCH] Allow a package to declare its desired symlink behavior. --- tools/onlpm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/onlpm.py b/tools/onlpm.py index 4784fb79..6faa6e2c 100755 --- a/tools/onlpm.py +++ b/tools/onlpm.py @@ -281,7 +281,7 @@ class OnlPackage(object): return True @staticmethod - def copyf(src, dst, root): + def copyf(src, dst, root, symlinks=False): if dst.startswith('/'): dst = dst[1:] @@ -291,7 +291,7 @@ class OnlPackage(object): # dstpath = os.path.join(root, dst) logger.debug("Copytree %s -> %s" % (src, dstpath)) - shutil.copytree(src, dstpath) + shutil.copytree(src, dstpath, symlinks=symlinks) else: # # If the destination ends in a '/' it means copy the filename @@ -353,7 +353,7 @@ class OnlPackage(object): self.pkg['__workdir'] = workdir for (src,dst) in self.pkg.get('files', {}): - OnlPackage.copyf(src, dst, root) + OnlPackage.copyf(src, dst, root, symlinks=self.pkg.get('symlinks', False)) for (src,dst) in self.pkg.get('optional-files', {}): if os.path.exists(src):