From ef2c42a8897b352799f4b2ad98e9a8d3f48cc2e5 Mon Sep 17 00:00:00 2001
From: Barry Smith <bsmith@mcs.anl.gov>
Date: Sat, 29 Oct 2016 22:57:41 -0500
Subject: [PATCH] Do not check directory layout for external packages (#2172)

External packages do not have an spec.yaml file so don't check for it.
Without this change any time a package depends on an external package
when the new package is installed you will get the error

Install prefix exists but contains no spec.yaml

This problem has also haunted me since I started using Spack since PETSc
depends on Python and I used an external python but fortunately it
was relatively easy to debug once I could reproduce it at will.

Funded-by: IDEAS
Project: IDEAS/xSDK
Time: 1 hour
---
 lib/spack/spack/database.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index e9bd07d92c..80ebf6a2cf 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -468,7 +468,7 @@ def _add(self, spec, directory_layout=None, explicit=False):
         if key not in self._data:
             installed = False
             path = None
-            if directory_layout:
+            if not spec.external and directory_layout:
                 path = directory_layout.path_for_spec(spec)
                 try:
                     directory_layout.check_installed(spec)
-- 
GitLab