summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOliver Breitwieser <oliver.breitwieser@kip.uni-heidelberg.de>2017-09-18 09:26:22 -0400
committerscheibelp <scheibel1@llnl.gov>2017-11-02 18:45:40 -0700
commit00a893aa79b076cb5403184a2871dc43355f7aff (patch)
tree45bd46523851dd2920ec065eee19c88fa6d433bb /lib
parent9024ddcf0536373fe73bfc6ec6fe0c76153d1e7d (diff)
downloadspack-00a893aa79b076cb5403184a2871dc43355f7aff.tar.gz
spack-00a893aa79b076cb5403184a2871dc43355f7aff.tar.bz2
spack-00a893aa79b076cb5403184a2871dc43355f7aff.tar.xz
spack-00a893aa79b076cb5403184a2871dc43355f7aff.zip
link_tree: support choosing the link function
This can be used to make hardlinks rather than symlinks.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/llnl/util/link_tree.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/llnl/util/link_tree.py b/lib/spack/llnl/util/link_tree.py
index 940526dd5c..33a16d71a9 100644
--- a/lib/spack/llnl/util/link_tree.py
+++ b/lib/spack/llnl/util/link_tree.py
@@ -64,7 +64,7 @@ class LinkTree(object):
return dest
return None
- def merge(self, dest_root, **kwargs):
+ def merge(self, dest_root, link=os.symlink, **kwargs):
"""Link all files in src into dest, creating directories
if necessary.
If ignore_conflicts is True, do not break when the target exists but
@@ -95,7 +95,7 @@ class LinkTree(object):
else:
raise AssertionError("File already exists: %s" % dest)
else:
- os.symlink(src, dest)
+ link(src, dest)
if ignore_conflicts:
return existing