From 8fe39be3df368d8169c23b91bec04350b580dbfb Mon Sep 17 00:00:00 2001 From: Jordan Galby <67924449+Jordan474@users.noreply.github.com> Date: Thu, 19 May 2022 16:45:18 +0200 Subject: Don't try to mkdir upstream directory when nonexistent (#30744) When an upstream is specified but the directory does not exist, don't create the directory for it, it might not be yours. --- lib/spack/spack/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index 1b10965a42..fc791595d6 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -356,10 +356,10 @@ class Database(object): self.prefix_fail_path = os.path.join(self._db_dir, 'prefix_failures') # Create needed directories and files - if not os.path.exists(self._db_dir): + if not is_upstream and not os.path.exists(self._db_dir): fs.mkdirp(self._db_dir) - if not os.path.exists(self._failure_dir) and not is_upstream: + if not is_upstream and not os.path.exists(self._failure_dir): fs.mkdirp(self._failure_dir) self.is_upstream = is_upstream -- cgit v1.2.3-70-g09d2