summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2016-10-10 12:13:20 -0400
committerTodd Gamblin <tgamblin@llnl.gov>2016-10-10 09:13:20 -0700
commit377ac68690fd1149694c9b2c189d134d7572fae3 (patch)
tree6d3a75cfb56b957b8aa6256ac68e09995fafaae1 /var
parent876c26f65828491cfe1b13ced7383747058ca9d2 (diff)
downloadspack-377ac68690fd1149694c9b2c189d134d7572fae3.tar.gz
spack-377ac68690fd1149694c9b2c189d134d7572fae3.tar.bz2
spack-377ac68690fd1149694c9b2c189d134d7572fae3.tar.xz
spack-377ac68690fd1149694c9b2c189d134d7572fae3.zip
Correct Charm++ install procedure (#1957)
Charm++ only creates symbolic links instead of copying files. Correct this.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/charm/package.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/charm/package.py b/var/spack/repos/builtin/packages/charm/package.py
index d67ac80de1..aa247fcc02 100644
--- a/var/spack/repos/builtin/packages/charm/package.py
+++ b/var/spack/repos/builtin/packages/charm/package.py
@@ -23,6 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
+import os
import platform
import shutil
import sys
@@ -169,4 +170,19 @@ class Charm(Package):
# this wouldn't be difficult.
build = Executable(join_path(".", "build"))
build(target, version, *options)
+
+ # Charm++'s install script does not copy files, it only creates
+ # symbolic links. Fix this.
+ for dirpath, dirnames, filenames in os.walk(prefix):
+ for filename in filenames:
+ filepath = join_path(dirpath, filename)
+ if os.path.islink(filepath):
+ tmppath = filepath + ".tmp"
+ # Skip dangling symbolic links
+ try:
+ shutil.copy2(filepath, tmppath)
+ os.remove(filepath)
+ os.rename(tmppath, filepath)
+ except:
+ pass
shutil.rmtree(join_path(prefix, "tmp"))