summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2022-12-06 12:55:43 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2022-12-06 14:19:12 +0100
commit810a24237ea4f05df671169203bc3f75717908a1 (patch)
treecd8b35b9f335e778e08d5dfcdcfaf8ee6534050e /bin
parent564aafc4c64c702fda0a6b378efde9717efe8457 (diff)
downloadjustbuild-810a24237ea4f05df671169203bc3f75717908a1.tar.gz
just-mr: Fix norc handling in Python script
If norc options is given then no checks for the rc_path (e.g., whether it points to a file or not) should even be considered.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/just-mr.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/just-mr.py b/bin/just-mr.py
index ce8557e5..3bc67b2a 100755
--- a/bin/just-mr.py
+++ b/bin/just-mr.py
@@ -566,7 +566,7 @@ def distdir_checkout(desc, repos):
for repo in distdir_repos:
# If repo does not exist, fail
if repo not in repos:
- print("No configuration for repository %s found" % (repo,))
+ print("No configuration for repository %s found" % (repo, ))
sys.exit(1)
repo_desc = repos[repo].get("repository", {})
repo_desc_type = repo_desc.get("type")
@@ -855,15 +855,15 @@ def read_location(location):
# read settings from just-mrrc and return config path
def read_justmrrc(rcpath, no_rc=False):
- if not rcpath:
- rcpath = DEFAULT_RC_PATH
- elif not os.path.isfile(rcpath):
- fail(f"cannot read rc file {rcpath}.")
-
rc = {}
- if os.path.isfile(rcpath) and not no_rc:
- with open(rcpath) as f:
- rc = json.load(f)
+ if not no_rc:
+ if not rcpath:
+ rcpath = DEFAULT_RC_PATH
+ elif not os.path.isfile(rcpath):
+ fail(f"cannot read rc file {rcpath}.")
+ if os.path.isfile(rcpath):
+ with open(rcpath) as f:
+ rc = json.load(f)
location = rc.get("local build root", None)
build_root = read_location(location) if location else None