diff options
author | Jordan Galby <67924449+Jordan474@users.noreply.github.com> | 2022-05-19 16:45:18 +0200 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-07-14 16:47:26 +0200 |
commit | f374fe8a624b54bfddebf6874e4361fcf6bf90e0 (patch) | |
tree | 23d22bdbc1c8e233cfafc1d1fcf873f63c3674b7 /lib | |
parent | 6193d59d5df9caf16d5bfacfb0b1776dd7cc3cca (diff) | |
download | spack-f374fe8a624b54bfddebf6874e4361fcf6bf90e0.tar.gz spack-f374fe8a624b54bfddebf6874e4361fcf6bf90e0.tar.bz2 spack-f374fe8a624b54bfddebf6874e4361fcf6bf90e0.tar.xz spack-f374fe8a624b54bfddebf6874e4361fcf6bf90e0.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/database.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index 2b99e33bb0..bfe98cd4a0 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -355,10 +355,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 |