mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
eliminate app.builds everywhere, it should be app['Builds']
The .txt format was the last place where the lowercase "builds" was used,
this converts references everywhere to be "Builds". This makes it possible
to load metadata YAML files with any YAML parser, then have it possible to
use fdroidserver methods on that data, like metadata.write_metadata().
The test files in tests/metadata/dump/*.yaml were manually edited by cutting
the builds: block and putting it the sort order for Builds: so the contents
should be unchanged.
```
sed -i \
-e 's/app\.builds/app.get('Builds', \[\])/g' \
-e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
-e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
-e "s/app\.get(Builds, \[\])/app.get('Builds', \[\])/g" \
-e "s/app\.get('Builds', \[\])\.append/app\['Builds'\].append/g" \
-e "s/app\['builds'\]/app.get('Builds', [])/g" \
*/*.*
```
This commit is contained in:
parent
877779195f
commit
bf25b4ca03
18 changed files with 275 additions and 279 deletions
|
|
@ -420,7 +420,7 @@ def main():
|
|||
else:
|
||||
build_dir = os.path.join('build', appid)
|
||||
|
||||
if app.builds:
|
||||
if app.get('Builds'):
|
||||
logging.info(_("Processing {appid}").format(appid=appid))
|
||||
# Set up vcs interface and make sure we have the latest code...
|
||||
vcs = common.getvcs(app.RepoType, app.Repo, build_dir)
|
||||
|
|
@ -434,9 +434,9 @@ def main():
|
|||
logging.warning(_('Scanner found {count} problems in {appid}:')
|
||||
.format(count=count, appid=appid))
|
||||
probcount += count
|
||||
app.builds = []
|
||||
app['Builds'] = []
|
||||
|
||||
for build in app.builds:
|
||||
for build in app.get('Builds', []):
|
||||
json_per_build = DEFAULT_JSON_PER_BUILD
|
||||
json_per_appid[build.versionCode] = json_per_build
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue