diff options
author | Ethan Chen <intervigil@gmail.com> | 2016-01-25 11:11:29 -0800 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-01-25 11:11:29 -0800 |
commit | 9be9dd173eb69ac581a78f619b90d027095446d4 (patch) | |
tree | 54ed4dc2d8f57a74fa979e36127a1bf56b77186f /tools/roomservice.py | |
parent | c5ef7f3284bd22f714b178038e42d838b275ade9 (diff) | |
download | build-9be9dd173eb69ac581a78f619b90d027095446d4.zip build-9be9dd173eb69ac581a78f619b90d027095446d4.tar.gz build-9be9dd173eb69ac581a78f619b90d027095446d4.tar.bz2 |
Revert "roomservice: check uniqueness by path, not name"
This reverts commit c5ef7f3284bd22f714b178038e42d838b275ade9.
Change-Id: I9a3cad3525a0ab8478343a346c68b258e3cbe120
Diffstat (limited to 'tools/roomservice.py')
-rwxr-xr-x | tools/roomservice.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/roomservice.py b/tools/roomservice.py index 2fcf114..ee8e5d8 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, path): +def exists_in_tree(lm, repository): for child in lm.getchildren(): - if child.attrib['path'] == repository: + if child.attrib['name'].endswith(repository): return True return False @@ -139,7 +139,7 @@ def get_from_manifest(devicename): return None -def is_in_manifest(projectpath): +def is_in_manifest(projectname): try: lm = ElementTree.parse(".repo/local_manifests/roomservice.xml") lm = lm.getroot() @@ -147,7 +147,7 @@ def is_in_manifest(projectpath): lm = ElementTree.Element("manifest") for localpath in lm.findall("project"): - if localpath.get("path") == projectpath: + if localpath.get("name") == projectname: return 1 ## Search in main manifest, too @@ -158,7 +158,7 @@ def is_in_manifest(projectpath): lm = ElementTree.Element("manifest") for localpath in lm.findall("project"): - if localpath.get("path") == projectpath: + if localpath.get("name") == projectname: 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_target): - print('CyanogenMod/%s already fetched to %s' % (repo_name, repo_target)) + if exists_in_tree(lm, repo_name): + print('CyanogenMod/%s already exists' % (repo_name)) 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['target_path']): + if not is_in_manifest("CyanogenMod/%s" % dependency['repository']): fetch_list.append(dependency) syncable_repos.append(dependency['target_path']) |