mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
Loop over all AM.xml files for forcever(sion|code)
This commit is contained in:
parent
23dc78da44
commit
3e9b70f688
1 changed files with 16 additions and 9 deletions
|
@ -475,6 +475,7 @@ 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'])
|
||||||
|
if thisbuild['subvercode'] is not None:
|
||||||
testsubvercode = int(thisbuild['subvercode'])
|
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)
|
||||||
|
@ -1328,14 +1329,20 @@ 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:
|
||||||
|
for path in manifest_paths:
|
||||||
|
if not os.path.isfile(path):
|
||||||
|
continue
|
||||||
if subprocess.call(['sed','-r','-i',
|
if subprocess.call(['sed','-r','-i',
|
||||||
's/android:versionName="[^"]+"/android:versionName="' + build['version'] + '"/g',
|
's/android:versionName="[^"]+"/android:versionName="' + build['version'] + '"/g',
|
||||||
'AndroidManifest.xml'], cwd=root_dir) !=0:
|
path], cwd=root_dir) != 0:
|
||||||
raise BuildException("Failed to amend manifest")
|
raise BuildException("Failed to amend manifest")
|
||||||
if 'forcevercode' in build:
|
if 'forcevercode' in build:
|
||||||
|
for path in manifest_paths:
|
||||||
|
if not os.path.isfile(path):
|
||||||
|
continue
|
||||||
if subprocess.call(['sed','-r','-i',
|
if subprocess.call(['sed','-r','-i',
|
||||||
's/android:versionCode="[^"]+"/android:versionCode="' + build['vercode'] + '"/g',
|
's/android:versionCode="[^"]+"/android:versionCode="' + build['vercode'] + '"/g',
|
||||||
'AndroidManifest.xml'], cwd=root_dir) !=0:
|
path], cwd=root_dir) != 0:
|
||||||
raise BuildException("Failed to amend manifest")
|
raise BuildException("Failed to amend manifest")
|
||||||
|
|
||||||
# Delete unwanted file...
|
# Delete unwanted file...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue