|
|
@ -203,29 +203,34 @@ def add_to_manifest(repositories, fallback_branch = None):
|
|
|
|
|
|
|
|
|
|
|
|
def fetch_dependencies(repo_path, fallback_branch = None):
|
|
|
|
def fetch_dependencies(repo_path, fallback_branch = None):
|
|
|
|
print('Looking for dependencies in %s' % repo_path)
|
|
|
|
print('Looking for dependencies in %s' % repo_path)
|
|
|
|
dependencies_path = repo_path + '/cm.dependencies'
|
|
|
|
dependencies_paths = [repo_path + '/lineage.dependencies', repo_path + '/cm.dependencies']
|
|
|
|
|
|
|
|
found_dependencies = False
|
|
|
|
syncable_repos = []
|
|
|
|
syncable_repos = []
|
|
|
|
verify_repos = []
|
|
|
|
verify_repos = []
|
|
|
|
|
|
|
|
|
|
|
|
if os.path.exists(dependencies_path):
|
|
|
|
for dependencies_path in dependencies_paths:
|
|
|
|
dependencies_file = open(dependencies_path, 'r')
|
|
|
|
if os.path.exists(dependencies_path):
|
|
|
|
dependencies = json.loads(dependencies_file.read())
|
|
|
|
dependencies_file = open(dependencies_path, 'r')
|
|
|
|
fetch_list = []
|
|
|
|
dependencies = json.loads(dependencies_file.read())
|
|
|
|
|
|
|
|
fetch_list = []
|
|
|
|
for dependency in dependencies:
|
|
|
|
|
|
|
|
if not is_in_manifest(dependency['target_path']):
|
|
|
|
for dependency in dependencies:
|
|
|
|
fetch_list.append(dependency)
|
|
|
|
if not is_in_manifest(dependency['target_path']):
|
|
|
|
syncable_repos.append(dependency['target_path'])
|
|
|
|
fetch_list.append(dependency)
|
|
|
|
verify_repos.append(dependency['target_path'])
|
|
|
|
syncable_repos.append(dependency['target_path'])
|
|
|
|
elif re.search("android_device_.*_.*$", dependency['repository']):
|
|
|
|
verify_repos.append(dependency['target_path'])
|
|
|
|
verify_repos.append(dependency['target_path'])
|
|
|
|
elif re.search("android_device_.*_.*$", dependency['repository']):
|
|
|
|
|
|
|
|
verify_repos.append(dependency['target_path'])
|
|
|
|
dependencies_file.close()
|
|
|
|
|
|
|
|
|
|
|
|
dependencies_file.close()
|
|
|
|
if len(fetch_list) > 0:
|
|
|
|
found_dependencies = True
|
|
|
|
print('Adding dependencies to manifest')
|
|
|
|
|
|
|
|
add_to_manifest(fetch_list, fallback_branch)
|
|
|
|
if len(fetch_list) > 0:
|
|
|
|
else:
|
|
|
|
print('Adding dependencies to manifest')
|
|
|
|
|
|
|
|
add_to_manifest(fetch_list, fallback_branch)
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not found_dependencies:
|
|
|
|
print('Dependencies file not found, bailing out.')
|
|
|
|
print('Dependencies file not found, bailing out.')
|
|
|
|
|
|
|
|
|
|
|
|
if len(syncable_repos) > 0:
|
|
|
|
if len(syncable_repos) > 0:
|
|
|
|