build: Fix roomservice project validation
Remove roomservice entries only if there is the project path and its revision.
Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I474e2a89212c55d2619e330b174b31aff5e320bb
diff --git a/build/tools/roomservice.py b/build/tools/roomservice.py
index 9e43bd8..8800407 100755
--- a/build/tools/roomservice.py
+++ b/build/tools/roomservice.py
@@ -230,17 +230,18 @@
# check for existing projects
for project in iterate_manifests():
- if project.get("path") == target_path and project.get("revision") != revision:
- print("WARNING: detected conflict in revisions for repository ", repository)
- current_dependency = str(project.get(repository))
- file = ES.parse('/'.join([local_manifest_dir, "roomservice.xml"]))
- file_root = file.getroot()
- for current_project in file_root.findall('project'):
- new_dependency = str(current_project.find('revision'))
- if new_dependency == current_dependency:
- file_root.remove(current_project)
- file.write('/'.join([local_manifest_dir, "roomservice.xml"]))
- return
+ if project.get("revision") is not None and project.get("path") is not None:
+ if project.get("path") == target_path and project.get("revision") != revision:
+ print("WARNING: detected conflict in revisions for repository ", repository)
+ current_dependency = str(project.get(repository))
+ file = ES.parse('/'.join([local_manifest_dir, "roomservice.xml"]))
+ file_root = file.getroot()
+ for current_project in file_root.findall('project'):
+ new_dependency = str(current_project.find('revision'))
+ if new_dependency == current_dependency:
+ file_root.remove(current_project)
+ file.write('/'.join([local_manifest_dir, "roomservice.xml"]))
+ return
def create_dependency_manifest(dependencies):
projects = []