spack edit: accept readonly packages (#19949)

This commit is contained in:
Wouter Deconinck 2020-11-16 19:14:46 -06:00 committed by GitHub
parent ef0a555ca2
commit 423e80af23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ def edit_package(name, repo_path, namespace):
if os.path.exists(path):
if not os.path.isfile(path):
tty.die("Something is wrong. '{0}' is not a file!".format(path))
if not os.access(path, os.R_OK | os.W_OK):
if not os.access(path, os.R_OK):
tty.die("Insufficient permissions on '%s'!" % path)
else:
tty.die("No package for '{0}' was found.".format(spec.name),