mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
Merge branch 'extlib' into 'master'
lint: only error out on missing extlib on versions not archived See merge request fdroid/fdroidserver!1579
This commit is contained in:
commit
99c3ea9966
3 changed files with 31 additions and 13 deletions
|
|
@ -4705,6 +4705,20 @@ def _install_ndk(ndk):
|
|||
)
|
||||
|
||||
|
||||
def calculate_archive_policy(app, default):
|
||||
"""Calculate the archive policy from the metadata and default config."""
|
||||
if app.get('ArchivePolicy') is not None:
|
||||
archive_policy = app['ArchivePolicy']
|
||||
else:
|
||||
archive_policy = default
|
||||
if app.get('VercodeOperation'):
|
||||
archive_policy *= len(app['VercodeOperation'])
|
||||
builds = [build for build in app.Builds if not build.disable]
|
||||
if app.Builds and archive_policy > len(builds):
|
||||
archive_policy = len(builds)
|
||||
return archive_policy
|
||||
|
||||
|
||||
FDROIDORG_MIRRORS = [
|
||||
{
|
||||
'isPrimary': True,
|
||||
|
|
|
|||
|
|
@ -526,13 +526,23 @@ def check_extlib_dir(apps):
|
|||
|
||||
used = set()
|
||||
for app in apps:
|
||||
for build in app.get('Builds', []):
|
||||
if app.Disabled:
|
||||
continue
|
||||
archive_policy = common.calculate_archive_policy(
|
||||
app, common.config['archive_older']
|
||||
)
|
||||
builds = [build for build in app.Builds if not build.disable]
|
||||
|
||||
for i in range(len(builds)):
|
||||
build = builds[i]
|
||||
for path in build.extlibs:
|
||||
path = Path(path)
|
||||
if path not in extlib_files:
|
||||
yield _(
|
||||
"{appid}: Unknown extlib {path} in build '{versionName}'"
|
||||
).format(appid=app.id, path=path, versionName=build.versionName)
|
||||
# Don't show error on archived versions
|
||||
if i >= len(builds) - archive_policy:
|
||||
yield _(
|
||||
"{appid}: Unknown extlib {path} in build '{versionName}'"
|
||||
).format(appid=app.id, path=path, versionName=build.versionName)
|
||||
else:
|
||||
used.add(path)
|
||||
|
||||
|
|
|
|||
|
|
@ -2276,15 +2276,9 @@ def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversi
|
|||
return sorted_list
|
||||
|
||||
for appid, app in apps.items():
|
||||
|
||||
if app.get('ArchivePolicy') is not None:
|
||||
keepversions = app['ArchivePolicy']
|
||||
else:
|
||||
keepversions = defaultkeepversions
|
||||
if app.get('VercodeOperation'):
|
||||
keepversions *= len(app['VercodeOperation'])
|
||||
if common.metadata_find_developer_signing_files(appid, app['CurrentVersionCode']):
|
||||
keepversions *= 2
|
||||
keepversions = common.calculate_archive_policy(app, defaultkeepversions)
|
||||
if common.metadata_find_developer_signing_files(appid, app['CurrentVersionCode']):
|
||||
keepversions *= 2
|
||||
|
||||
logging.debug(_("Checking archiving for {appid} - apks:{integer}, keepversions:{keep}, archapks:{arch}")
|
||||
.format(appid=appid, integer=len(apks), keep=keepversions, arch=len(archapks)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue