mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
standardize on versionCode as spelling
This commit is contained in:
parent
e8d4d8fc6a
commit
1068057524
5 changed files with 14 additions and 14 deletions
|
|
@ -93,7 +93,7 @@ def check_http(app: metadata.App) -> tuple[Optional[str], Optional[int]]:
|
|||
|
||||
m = re.search(codeex, page)
|
||||
if not m:
|
||||
raise FDroidException("No RE match for version code")
|
||||
raise FDroidException("No RE match for versionCode")
|
||||
vercode = common.version_code_string_to_int(m.group(1).strip())
|
||||
|
||||
if urlver != '.':
|
||||
|
|
@ -213,7 +213,7 @@ def check_tags(app: metadata.App, pattern: str) -> tuple[str, int, str]:
|
|||
if codeex:
|
||||
m = re.search(codeex, filecontent)
|
||||
if not m:
|
||||
logging.debug(f"UpdateCheckData regex {codeex} for version code"
|
||||
logging.debug(f"UpdateCheckData regex {codeex} for versionCode"
|
||||
f" has no match in tag {tag}")
|
||||
continue
|
||||
|
||||
|
|
|
|||
|
|
@ -1098,7 +1098,7 @@ def get_metadata_files(vercodes):
|
|||
Parameters
|
||||
----------
|
||||
vercodes
|
||||
version codes as returned by read_pkg_args()
|
||||
versionCodes as returned by read_pkg_args()
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
@ -2295,7 +2295,7 @@ def parse_androidmanifests(paths, app):
|
|||
.format(package, version, vercode))
|
||||
|
||||
# Always grab the package name and version name in case they are not
|
||||
# together with the highest version code
|
||||
# together with the highest versionCode
|
||||
if max_package is None and package is not None:
|
||||
max_package = package
|
||||
if max_version is None and version is not None:
|
||||
|
|
@ -2608,7 +2608,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
|
|||
# Remove forced debuggable flags
|
||||
remove_debuggable_flags(root_dir)
|
||||
|
||||
# Insert version code and number into the manifest if necessary
|
||||
# Insert versionCode and number into the manifest if necessary
|
||||
if build.forceversion:
|
||||
logging.info("Changing the version name")
|
||||
for path in manifest_paths(root_dir, flavors):
|
||||
|
|
@ -2624,7 +2624,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
|
|||
path)
|
||||
|
||||
if build.forcevercode:
|
||||
logging.info("Changing the version code")
|
||||
logging.info("Changing the versionCode")
|
||||
for path in manifest_paths(root_dir, flavors):
|
||||
if not path.is_file():
|
||||
continue
|
||||
|
|
@ -2949,7 +2949,7 @@ def get_apk_id(apkfile):
|
|||
Returns
|
||||
-------
|
||||
appid
|
||||
version code
|
||||
versionCode
|
||||
version name
|
||||
|
||||
"""
|
||||
|
|
@ -3564,7 +3564,7 @@ def metadata_find_signing_files(appid, vercode):
|
|||
appid
|
||||
app id string
|
||||
vercode
|
||||
app version code
|
||||
app versionCode
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
@ -4426,7 +4426,7 @@ def string_is_integer(string):
|
|||
|
||||
|
||||
def version_code_string_to_int(vercode):
|
||||
"""Convert an version code string of any base into an int."""
|
||||
"""Convert an versionCode string of any base into an int."""
|
||||
# TODO: Python 3.6 allows underscores in numeric literals
|
||||
vercode = vercode.replace('_', '')
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ def main():
|
|||
if not versionName:
|
||||
logging.warning(_('Could not find latest version name'))
|
||||
if not versionCode:
|
||||
logging.warning(_('Could not find latest version code'))
|
||||
logging.warning(_('Could not find latest versionCode'))
|
||||
else:
|
||||
raise FDroidException(_("No gradle project could be found. Specify --subdir?"))
|
||||
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ def check_update_check_data_int(app): # noqa: D403
|
|||
# codeex can be empty as well
|
||||
if codeex and not versioncode_check_pattern.search(codeex):
|
||||
yield _(
|
||||
f'UpdateCheckData must match the version code as integer (\\d or [0-9]): {codeex}'
|
||||
f'UpdateCheckData must match the versionCode as integer (\\d or [0-9]): {codeex}'
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ def insert_obbs(repodir, apps, apks):
|
|||
obbWarnDelete(f, _('OBB filename must start with "main." or "patch.":'))
|
||||
continue
|
||||
if not re.match(r'^-?[0-9]+$', chunks[1]):
|
||||
obbWarnDelete(f, _('The OBB version code must come after "{name}.":')
|
||||
obbWarnDelete(f, _('The OBB versionCode must come after "{name}.":')
|
||||
.format(name=chunks[0]))
|
||||
continue
|
||||
versionCode = int(chunks[1])
|
||||
|
|
@ -550,7 +550,7 @@ VERSION_STRING_RE = re.compile(r'^([0-9]+)\.([0-9]+)\.([0-9]+)$')
|
|||
|
||||
def version_string_to_int(version):
|
||||
"""
|
||||
Convert sermver version designation to version code.
|
||||
Convert semantic version designation to versionCode.
|
||||
|
||||
Approximately convert a [Major].[Minor].[Patch] version string
|
||||
consisting of numeric characters (0-9) and periods to a number. The
|
||||
|
|
@ -2322,7 +2322,7 @@ def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversi
|
|||
continue
|
||||
apkList.append(apk)
|
||||
|
||||
# Sort the apk list by version code. First is highest/newest.
|
||||
# Sort the apk list by versionCode. First is highest/newest.
|
||||
sorted_list = sorted(apkList, key=lambda apk: apk['versionCode'], reverse=True)
|
||||
if currentVersionApk:
|
||||
# Insert apk which corresponds to currentVersion at the front
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue