summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorNathan Hanford <8302958+nhanford@users.noreply.github.com>2021-01-20 09:17:47 -0800
committerTamara Dahlgren <dahlgren1@llnl.gov>2021-02-17 17:07:44 -0800
commitcdd86bddecacb1201ca306992265e0f255cda7e3 (patch)
tree587429e2452eaf6947892a05205a26b9c076735e /var
parent58d167bce94d77f0a16b6bec39525e9008c1ba94 (diff)
downloadspack-cdd86bddecacb1201ca306992265e0f255cda7e3.tar.gz
spack-cdd86bddecacb1201ca306992265e0f255cda7e3.tar.bz2
spack-cdd86bddecacb1201ca306992265e0f255cda7e3.tar.xz
spack-cdd86bddecacb1201ca306992265e0f255cda7e3.zip
[WIP] relocate.py: parallelize test replacement logic (#19690)
* sbang pushed back to callers; star moved to util.lang * updated unit test * sbang test moved; local tests pass Co-authored-by: Nathan Hanford <hanford1@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/old-sbang/package.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/old-sbang/package.py b/var/spack/repos/builtin.mock/packages/old-sbang/package.py
new file mode 100644
index 0000000000..3308f91611
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/old-sbang/package.py
@@ -0,0 +1,35 @@
+# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack import *
+
+
+class OldSbang(Package):
+ """Toy package for testing the old sbang replacement problem"""
+
+ homepage = "https://www.example.com"
+ url = "https://www.example.com/old-sbang.tar.gz"
+
+ version('1.0.0', '0123456789abcdef0123456789abcdef')
+
+ def install(self, spec, prefix):
+ mkdirp(prefix.bin)
+
+ sbang_style_1 = '''#!/bin/bash {0}/bin/sbang
+#!/usr/bin/env python
+
+{1}
+ '''.format(spack.paths.prefix, prefix.bin)
+ sbang_style_2 = '''#!/bin/sh {0}/bin/sbang
+#!/usr/bin/env python
+
+{1}
+ '''.format(spack.store.unpadded_root, prefix.bin)
+ with open('%s/sbang-style-1.sh' % self.prefix.bin, 'w') as f:
+ f.write(sbang_style_1)
+
+ with open('%s/sbang-style-2.sh' % self.prefix.bin, 'w') as f:
+ f.write(sbang_style_2)