mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 18:50:11 +02:00
Loop over all AM.xml files for forcever(sion|code)
This commit is contained in:
parent
23dc78da44
commit
3e9b70f688
@ -475,7 +475,8 @@ def parse_metadata(metafile, **kw):
|
|||||||
raise MetaDataException("Invalid version code for build in " + metafile.name)
|
raise MetaDataException("Invalid version code for build in " + metafile.name)
|
||||||
try:
|
try:
|
||||||
testvercode = int(thisbuild['vercode'])
|
testvercode = int(thisbuild['vercode'])
|
||||||
testsubvercode = int(thisbuild['subvercode'])
|
if thisbuild['subvercode'] is not None:
|
||||||
|
testsubvercode = int(thisbuild['subvercode'])
|
||||||
except:
|
except:
|
||||||
raise MetaDataException("Invalid version code for build in " + metafile.name)
|
raise MetaDataException("Invalid version code for build in " + metafile.name)
|
||||||
thisbuild['commit'] = parts[2]
|
thisbuild['commit'] = parts[2]
|
||||||
@ -1328,15 +1329,21 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path,
|
|||||||
|
|
||||||
# Insert version code and number into the manifest if necessary...
|
# Insert version code and number into the manifest if necessary...
|
||||||
if 'forceversion' in build:
|
if 'forceversion' in build:
|
||||||
if subprocess.call(['sed','-r','-i',
|
for path in manifest_paths:
|
||||||
's/android:versionName="[^"]+"/android:versionName="' + build['version'] + '"/g',
|
if not os.path.isfile(path):
|
||||||
'AndroidManifest.xml'], cwd=root_dir) !=0:
|
continue
|
||||||
raise BuildException("Failed to amend manifest")
|
if subprocess.call(['sed','-r','-i',
|
||||||
|
's/android:versionName="[^"]+"/android:versionName="' + build['version'] + '"/g',
|
||||||
|
path], cwd=root_dir) != 0:
|
||||||
|
raise BuildException("Failed to amend manifest")
|
||||||
if 'forcevercode' in build:
|
if 'forcevercode' in build:
|
||||||
if subprocess.call(['sed','-r','-i',
|
for path in manifest_paths:
|
||||||
's/android:versionCode="[^"]+"/android:versionCode="' + build['vercode'] + '"/g',
|
if not os.path.isfile(path):
|
||||||
'AndroidManifest.xml'], cwd=root_dir) !=0:
|
continue
|
||||||
raise BuildException("Failed to amend manifest")
|
if subprocess.call(['sed','-r','-i',
|
||||||
|
's/android:versionCode="[^"]+"/android:versionCode="' + build['vercode'] + '"/g',
|
||||||
|
path], cwd=root_dir) != 0:
|
||||||
|
raise BuildException("Failed to amend manifest")
|
||||||
|
|
||||||
# Delete unwanted file...
|
# Delete unwanted file...
|
||||||
if 'rm' in build:
|
if 'rm' in build:
|
||||||
|
Loading…
Reference in New Issue
Block a user