diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 10f4606972a..690ce075cb6 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1252,18 +1252,14 @@ def installed(self): Returns: True if the package has been installed, False otherwise. """ - has_prefix = os.path.isdir(self.prefix) try: # If the spec is in the DB, check the installed # attribute of the record - rec = spack.store.db.get_record(self.spec) - db_says_installed = rec.installed + return spack.store.db.get_record(self.spec).installed except KeyError: # If the spec is not in the DB, the method # above raises a Key error - db_says_installed = False - - return has_prefix and db_says_installed + return False @property def prefix(self):