summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAntonio Arena <antonio.arena@kaust.edu.sa>2020-04-13 21:22:29 +0300
committerGitHub <noreply@github.com>2020-04-13 13:22:29 -0500
commit0a6d9f4c550b3b29c12cb1c49d69e9cc5b582b75 (patch)
tree6269e4a5e1f595da9df2a70db80ca8e3f14ab84e /var
parent0c28a271ae354492ff3b3b7dcfefa0a3f7085d35 (diff)
downloadspack-0a6d9f4c550b3b29c12cb1c49d69e9cc5b582b75.tar.gz
spack-0a6d9f4c550b3b29c12cb1c49d69e9cc5b582b75.tar.bz2
spack-0a6d9f4c550b3b29c12cb1c49d69e9cc5b582b75.tar.xz
spack-0a6d9f4c550b3b29c12cb1c49d69e9cc5b582b75.zip
Patch Mathematica (#16019)
* Patch Mathematica Mathematica installer moves all files and directories from installation directory to a backup one. The problem is that it also moves .spack to this backup location. Once it's done it does not move .spack back where it was. My patch creates a copy of .spack to /tmp then moves it back right before exiting the install call. * Make lint happy * Use Spack native copy() As suggested in peer-review let's: - Copy .spack to stage directory so I don't have to use random - Use Spack native copy() to do these operations * Use join_path to create paths As per peer-review suggestion: - Use join_path to create paths - Use copy_tree since we're copying a directory that could have sub-directories
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mathematica/package.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mathematica/package.py b/var/spack/repos/builtin/packages/mathematica/package.py
index f7171c6081..8ef546200f 100644
--- a/var/spack/repos/builtin/packages/mathematica/package.py
+++ b/var/spack/repos/builtin/packages/mathematica/package.py
@@ -31,6 +31,9 @@ class Mathematica(Package):
license_url = 'https://reference.wolfram.com/language/tutorial/RegistrationAndPasswords.html#857035062'
def install(self, spec, prefix):
+ # Backup .spack because Mathematica moves it but never restores it
+ copy_tree(join_path(prefix, '.spack'), self.stage)
+
sh = which('sh')
sh(self.stage.archive_file, '--', '-auto', '-verbose',
'-targetdir={0}'.format(prefix),
@@ -43,3 +46,6 @@ class Mathematica(Package):
ln = which('ln')
ws_path = os.path.join(prefix, 'Executables', 'wolframscript')
ln('-s', ws_path, ws_link_path)
+
+ # Move back .spack where it belongs
+ copy_tree(join_path(self.stage, '.spack'), prefix)