Skip to content

Commit

Permalink
Merge pull request #8 from flathub/misc-fixes
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
alexlarsson committed Sep 3, 2019
2 parents 9b0d8c1 + 4812447 commit edcafbd
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions master/buildbot/flathub_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,17 +1342,35 @@ def run(self):
# This strips /* comments */
manifest = json.loads(re.sub(r'/\*.*?\*/', '', manifest_content))

sdk_name = manifest["sdk"]

# Check if SDK version is specified in ref form
if "//" in sdk_name:
sdk_version = manifest["sdk"].split("//")[-1]
else:
sdk_version = manifest["runtime-version"]

# Get all runtimes to check for available architectures later
runtimes = get_runtimes('flathub')
if not runtimes.get(manifest["sdk"], {}).get(manifest["runtime-version"], []) and flathub_branch in ('test', 'beta'):
if not runtimes.get(sdk_name, {}).get(sdk_version, []) and flathub_default_branch in ('test', 'beta'):
# Check also in flathub-beta for test and beta builds
runtimes = get_runtimes('flathub-beta')

sdk_arches = set(runtimes.get(manifest["sdk"], {}).get(manifest["runtime-version"], []))
if len(sdk_arches) == 0:
self.descriptionDone = ["Could not find requested SDK"]
defer.returnValue(FAILURE)
return

if "sdk-extensions" in manifest:
for extension in manifest["sdk-extensions"]:
if runtimes.get(extension, {}).get(manifest["runtime-version"], []):
sdk_arches = sdk_arches & set(runtimes[extension][manifest["runtime-version"]])
if runtimes.get(extension, {}).get(sdk_version, []):
sdk_arches = sdk_arches & set(runtimes[extension][sdk_version])

if len(sdk_arches) == 0:
self.descriptionDone = ["Could not find requested SDK extensions"]
defer.returnValue(FAILURE)
return

# This could have been set by the change event, otherwise look in config or default
flathub_arches_prop = props.getProperty('flathub_arches', None)
Expand All @@ -1375,7 +1393,7 @@ def run(self):
return

if len(flathub_arches_prop) == 0:
self.descriptionDone = ["No build arch specified or no compatible SDK has been found"]
self.descriptionDone = ["No compatible architectures found for required SDK or SDK extensions"]
defer.returnValue(FAILURE)
return

Expand Down

0 comments on commit edcafbd

Please sign in to comment.