use db lookup that cannot return None

This commit is contained in:
Gregory Becker 2024-08-28 19:05:56 -07:00
parent eaf332c03e
commit 78e39f2207
No known key found for this signature in database
GPG Key ID: 2362541F6D14ED84

View File

@ -2301,8 +2301,8 @@ def install(self) -> None:
if pkg.spec.installed: if pkg.spec.installed:
# Do not clean up this was an overwrite that wasn't completed # Do not clean up this was an overwrite that wasn't completed
overwrite = spec.dag_hash() in task.request.overwrite overwrite = spec.dag_hash() in task.request.overwrite
rec, _ = self._check_db(pkg.spec) rec = spack.store.STORE.db.get_record(pkg.spec)
incomplete = rec is None or task.request.overwrite_time > rec.installation_time incomplete = task.request.overwrite_time > rec.installation_time
if not (overwrite and incomplete): if not (overwrite and incomplete):
self._cleanup_task(pkg) self._cleanup_task(pkg)