roomservice: check all device repositories

Some devices have the same codename but shipped a long time
ago and may not have a current branch set up.
Continue looking up all repositories until a match is found
or no repos are left to check.

For example:

  - android_device_amazon_thor
    - cm-14.1
  - android_device_xiaomi_thor
    - lineage-21.0

  - android_device_semc_zeus
    - jellybean
  - android_device_xiaomi_zeus
    - lineage-21.0

  - android_device_amazon_otter
    - cm-12.1
  - android_device_shift_otter
    - lineage-21.0

Change-Id: Icf9826b31efd872363fdfe73d5a71ff2d06cbe20
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
This commit is contained in:
Alexander Martinz
2024-09-02 18:10:10 +02:00
committed by Michael Bestas
parent 2adbe41213
commit 8e47b88870

View File

@@ -282,7 +282,7 @@ def get_default_or_fallback_revision(repo_name):
for branch in [branch['name'] for branch in result]:
print(branch)
print("Use the ROOMSERVICE_BRANCHES environment variable to specify a list of fallback branches.")
sys.exit()
return ""
if depsonly:
repo_path = get_from_manifest(device)
@@ -301,6 +301,12 @@ else:
manufacturer = repo_name.replace("android_device_", "").replace("_" + device, "")
repo_path = "device/%s/%s" % (manufacturer, device)
revision = get_default_or_fallback_revision(repo_name)
if revision == "":
# Some devices have the same codename but shipped a long time ago and may not have
# a current branch set up.
# Continue looking up all repositories until a match is found or no repos are left
# to check.
continue
device_repository = {'repository':repo_name,'target_path':repo_path,'branch':revision}
add_to_manifest([device_repository])