update: take build subdir into account when looking for triple-t data

Implemented as a fallback solution when parsing settings.gradle
and globbing the build dir with "'*', 'src', '*', 'play'" did not
yield results.

Before, the logic would not find triple-t metadata in projects where
settings.gradle is in a subdirectory or 'src' is found at a directory
depth != 2.

Closes fdroid/fdroiddata#2295
This commit is contained in:
Christian Beier 2021-03-11 15:52:25 +01:00 committed by Hans-Christoph Steiner
parent dbf80ad771
commit 553daf8552

View file

@ -1058,6 +1058,8 @@ def copy_triple_t_store_metadata(apps):
gradle_subdirs.add(p) gradle_subdirs.add(p)
if not gradle_subdirs: if not gradle_subdirs:
gradle_subdirs.update(glob.glob(os.path.join('build', packageName, '*', 'src', '*', 'play'))) gradle_subdirs.update(glob.glob(os.path.join('build', packageName, '*', 'src', '*', 'play')))
if not gradle_subdirs and len(app.get('Builds', [])) and app.get('Builds', [])[-1].subdir:
gradle_subdirs.update(glob.glob(os.path.join('build', packageName, app.get('Builds', [])[-1].subdir, 'src', '*', 'play')))
for d in gradle_subdirs: for d in gradle_subdirs:
logging.debug('Triple-T Gradle Play Publisher: ' + d) logging.debug('Triple-T Gradle Play Publisher: ' + d)