Allow a package to declare its desired symlink behavior.

This commit is contained in:
Jeffrey Townsend
2018-04-18 16:35:26 +00:00
parent f818730f36
commit c43e647c02

View File

@@ -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):