summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-06-07 21:43:52 -0700
committerGitHub <noreply@github.com>2020-06-08 06:43:52 +0200
commitbd1a0a9ad4c9ac19a50c60f75aba6588c8ccfe6c (patch)
tree36c42d9e8884c19cc13752dbd7c5b399e89f9d7f /var
parent763760cfe0fea5d0a1e4e1a5a478ee5d65d2a65e (diff)
downloadspack-bd1a0a9ad4c9ac19a50c60f75aba6588c8ccfe6c.tar.gz
spack-bd1a0a9ad4c9ac19a50c60f75aba6588c8ccfe6c.tar.bz2
spack-bd1a0a9ad4c9ac19a50c60f75aba6588c8ccfe6c.tar.xz
spack-bd1a0a9ad4c9ac19a50c60f75aba6588c8ccfe6c.zip
view remove: directly check whether specs own files before removing from view (#16955)
Bugfix for hardlinks and copies
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/needs-relocation/package.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/needs-relocation/package.py b/var/spack/repos/builtin.mock/packages/needs-relocation/package.py
new file mode 100644
index 0000000000..681a8a53ed
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/needs-relocation/package.py
@@ -0,0 +1,28 @@
+# Copyright 2013-2020 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 *
+
+
+def check(condition, msg):
+ """Raise an install error if condition is False."""
+ if not condition:
+ raise InstallError(msg)
+
+
+class NeedsRelocation(Package):
+ """A dumy package that encodes its prefix."""
+ homepage = 'https://www.cmake.org'
+ url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz'
+
+ version('0.0.0', '12345678qwertyuiasdfghjkzxcvbnm0')
+
+ def install(self, spec, prefix):
+ mkdirp(prefix.bin)
+
+ exe = join_path(prefix.bin, 'exe')
+ with open(exe, 'w') as f:
+ f.write(prefix)
+ set_executable(exe)