From 6462bd692272c5cc30caaef92ee913eb9b4185c5 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Sun, 31 Jul 2022 17:12:46 +0300 Subject: [PATCH 1/2] fix: define `repos_from_e` to fix builds with a custom `roomservice.xml` Passing in a custom `local_manifests/roomservice.xml` triggers this script to run in depsonly mode, in which `repos_from_e` doesn't get defined. An exception is thrown once `add_to_manifest` tries to access it, so this small change makes sure it is always defined. --- build/tools/roomservice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/build/tools/roomservice.py b/build/tools/roomservice.py index f337b1c4d..64fa13217 100755 --- a/build/tools/roomservice.py +++ b/build/tools/roomservice.py @@ -42,6 +42,7 @@ from xml.etree import ElementTree product = sys.argv[1] gitlab_api_url = "https://gitlab.e.foundation/api/v4" +repos_from_e = False if len(sys.argv) > 2: depsonly = sys.argv[2] -- GitLab From 17cb0242d4c2ee0f583d86cb406bf01dfc65ce30 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Sun, 31 Jul 2022 17:13:09 +0300 Subject: [PATCH 2/2] fix: minor whitespace fixes --- build/tools/roomservice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/tools/roomservice.py b/build/tools/roomservice.py index 64fa13217..958a39455 100755 --- a/build/tools/roomservice.py +++ b/build/tools/roomservice.py @@ -321,11 +321,11 @@ else: if not has_branch(result, default_revision): if repos_from_e: gitlabreq = urllib.request.Request("{}/projects/{}/repository/tags".format(gitlab_api_url, repository['id'])) - result.extend (json.loads(urllib.request.urlopen(gitlabreq).read().decode())) + result.extend(json.loads(urllib.request.urlopen(gitlabreq).read().decode())) else: githubreq = urllib.request.Request(repository['tags_url'].replace('{/tag}', '')) add_auth(githubreq) - result.extend (json.loads(urllib.request.urlopen(githubreq).read().decode())) + result.extend(json.loads(urllib.request.urlopen(githubreq).read().decode())) repo_path = "device/%s/%s" % (manufacturer, device) adding = {'repository':repo_name,'target_path':repo_path} fallback_branch = None -- GitLab