Skip to content

Commit

Permalink
Upstreams: don't write metadata directory to upstream DB (#15526)
Browse files Browse the repository at this point in the history
When trying to use an upstream Spack repository, as of f2aca86 Spack
was attempting to write to the upstream DB based on a new metadata
directory added in that commit. Upstream DBs are read-only, so this
should not occur.

This adds a check to prevent Spack from writing to the upstream DB
  • Loading branch information
germasch authored and tgamblin committed Mar 20, 2020
1 parent 296d58e commit 09e13cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spack/spack/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def __init__(self, root, db_dir=None, upstream_dbs=None,
if not os.path.exists(self._db_dir):
mkdirp(self._db_dir)

if not os.path.exists(self._failure_dir):
if not os.path.exists(self._failure_dir) and not is_upstream:
mkdirp(self._failure_dir)

self.is_upstream = is_upstream
Expand Down

0 comments on commit 09e13cf

Please sign in to comment.