summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnav Gupta <championswimmer@gmail.com>2016-01-24 21:56:22 +0530
committerArnav Gupta <championswimmer@gmail.com>2016-01-25 04:13:10 +0530
commitc5ef7f3284bd22f714b178038e42d838b275ade9 (patch)
treeb033a149b0f103279750758df0ef3e6ce2960630 /tools
parent420da62d60b3197f6c7e57609beea915e4110092 (diff)
downloadbuild-c5ef7f3284bd22f714b178038e42d838b275ade9.zip
build-c5ef7f3284bd22f714b178038e42d838b275ade9.tar.gz
build-c5ef7f3284bd22f714b178038e42d838b275ade9.tar.bz2
roomservice: check uniqueness by path, not name
For repos such as hardware/qcom/media-caf we are using the same name with different branches for different paths. for eg. CyanogenMod/hardware_qcom_media-caf(branch:8994) - fetch to : /hardware/qcom/media-caf/8994 CyanogenMod/hardware_qcom_media-caf(branch:8960) - fetch to : /hardware/qcom/media-caf/8960 For such cases roomservice won't pick up a new path if one already exists. We should check for unique by target path instead. Change-Id: I0a97b48ccefc5e1e3dbee803bdbcf554db2c3fc9 Signed-off-by: Arnav Gupta <championswimmer@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/roomservice.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/roomservice.py b/tools/roomservice.py
index ee8e5d8..2fcf114 100755
--- a/tools/roomservice.py
+++ b/tools/roomservice.py
@@ -87,9 +87,9 @@ if not depsonly:
local_manifests = r'.repo/local_manifests'
if not os.path.exists(local_manifests): os.makedirs(local_manifests)
-def exists_in_tree(lm, repository):
+def exists_in_tree(lm, path):
for child in lm.getchildren():
- if child.attrib['name'].endswith(repository):
+ if child.attrib['path'] == repository:
return True
return False
@@ -139,7 +139,7 @@ def get_from_manifest(devicename):
return None
-def is_in_manifest(projectname):
+def is_in_manifest(projectpath):
try:
lm = ElementTree.parse(".repo/local_manifests/roomservice.xml")
lm = lm.getroot()
@@ -147,7 +147,7 @@ def is_in_manifest(projectname):
lm = ElementTree.Element("manifest")
for localpath in lm.findall("project"):
- if localpath.get("name") == projectname:
+ if localpath.get("path") == projectpath:
return 1
## Search in main manifest, too
@@ -158,7 +158,7 @@ def is_in_manifest(projectname):
lm = ElementTree.Element("manifest")
for localpath in lm.findall("project"):
- if localpath.get("name") == projectname:
+ if localpath.get("path") == projectpath:
return 1
return None
@@ -173,8 +173,8 @@ def add_to_manifest(repositories, fallback_branch = None):
for repository in repositories:
repo_name = repository['repository']
repo_target = repository['target_path']
- if exists_in_tree(lm, repo_name):
- print('CyanogenMod/%s already exists' % (repo_name))
+ if exists_in_tree(lm, repo_target):
+ print('CyanogenMod/%s already fetched to %s' % (repo_name, repo_target))
continue
print('Adding dependency: CyanogenMod/%s -> %s' % (repo_name, repo_target))
@@ -210,7 +210,7 @@ def fetch_dependencies(repo_path, fallback_branch = None):
fetch_list = []
for dependency in dependencies:
- if not is_in_manifest("CyanogenMod/%s" % dependency['repository']):
+ if not is_in_manifest("CyanogenMod/%s" % dependency['target_path']):
fetch_list.append(dependency)
syncable_repos.append(dependency['target_path'])