summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2015-10-15 12:44:02 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2015-10-15 12:44:02 -0700
commit4997f0fe57e65002d8122da05a4f203f51ac4345 (patch)
tree2baf46b2654656b8bd62c3280c350efb7ac99a67 /lib
parentc985ad7644e00fa2fd5253d6b3f761a2596c6c4b (diff)
downloadspack-4997f0fe57e65002d8122da05a4f203f51ac4345.tar.gz
spack-4997f0fe57e65002d8122da05a4f203f51ac4345.tar.bz2
spack-4997f0fe57e65002d8122da05a4f203f51ac4345.tar.xz
spack-4997f0fe57e65002d8122da05a4f203f51ac4345.zip
Move logic for tracking the build log into package.py (since that is what is
managing the build log) and expose as package.build_log_path.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/test-install.py11
-rw-r--r--lib/spack/spack/package.py8
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py
index f2c40e57e4..8514042239 100644
--- a/lib/spack/spack/cmd/test-install.py
+++ b/lib/spack/spack/cmd/test-install.py
@@ -97,21 +97,14 @@ def create_test_output(topSpec, newInstalls, output):
bId = BuildId(spec.name, spec.version, spec.dag_hash())
package = spack.db.get(spec)
- if package.installed:
- buildLogPath = spack.install_layout.build_log_path(spec)
- else:
- #TODO: search recursively under stage.path instead of only within
- # stage.source_path
- buildLogPath = join_path(package.stage.source_path, 'spack-build.out')
-
- with open(buildLogPath, 'rb') as F:
+ with open(package.build_log_path, 'rb') as F:
lines = F.readlines()
errMessages = list(line for line in lines if
re.search('error:', line, re.IGNORECASE))
errOutput = errMessages if errMessages else lines[-10:]
errOutput = '\n'.join(itertools.chain(
[spec.to_yaml(), "Errors:"], errOutput,
- ["Build Log:", buildLogPath]))
+ ["Build Log:", package.build_log_path]))
output.add_test(bId, package.installed, errOutput)
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 61606d0590..da19a7c398 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -864,6 +864,14 @@ class Package(object):
@property
+ def build_log_path(self):
+ if self.installed:
+ return spack.install_layout.build_log_path(spec)
+ else:
+ return join_path(self.stage.source_path, 'spack-build.out')
+
+
+ @property
def module(self):
"""Use this to add variables to the class's module's scope.
This lets us use custom syntax in the install method.