diff --git a/README b/README index 140b6a0d..baaeaa7a 100644 --- a/README +++ b/README @@ -160,10 +160,13 @@ configuration to the build. These are: AndroidManifest.xml. antcommand=xxx - Specify an alternate ant command (target) instead of the default 'release'. - insertversion=x - If specified, the pattern 'x' in the AndroidManifest.xml is - replaced with the version number for the build. - insertvercode=x - If specified, the pattern 'x' in the AndroidManifest.xml is - replaced with the version code for the build. + forceversion=yes - If specified, the package version in AndroidManifest.xml is + replaced with the version number for the build as specified + in recipe. Useful for cases when upstream repo missed to + update it for specific tag, or to build an arbitrary revision. + forcevercode=yes - If specified, the package vercode in the AndroidManifest.xml is + replaced with the version code for the build. See also + forceversion. update=no By default, 'android update project' is used to generate or update the build.xml file. Specifying update=no bypasses that. diff --git a/common.py b/common.py index b020df0a..8043eadd 100644 --- a/common.py +++ b/common.py @@ -737,14 +737,14 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j f.close() # Insert version code and number into the manifest if necessary... - if build.has_key('insertversion'): - if subprocess.call(['sed','-i','s/' + build['insertversion'] + - '/' + build['version'] +'/g', + if build.has_key('forceversion'): + if subprocess.call(['sed','-r','-i', + 's/android:versionName="[^"]+"/android:versionName="' + build['version'] + '"/g', 'AndroidManifest.xml'], cwd=root_dir) !=0: raise BuildException("Failed to amend manifest") - if build.has_key('insertvercode'): - if subprocess.call(['sed','-i','s/' + build['insertvercode'] + - '/' + build['vercode'] +'/g', + if build.has_key('forcevercode'): + if subprocess.call(['sed','-r','-i', + 's/android:versionCode="[^"]+"/android:versionCode="' + build['vercode'] + '"/g', 'AndroidManifest.xml'], cwd=root_dir) !=0: raise BuildException("Failed to amend manifest") diff --git a/fdroid.texi b/fdroid.texi index e3a3e89e..f586de93 100644 --- a/fdroid.texi +++ b/fdroid.texi @@ -364,13 +364,15 @@ the directory that contains AndroidManifest.xml. Specify an alternate ant command (target) instead of the default 'release'. -@item insertversion=x -If specified, the pattern 'x' in the AndroidManifest.xml is replaced -with the version number for the build. +@item forceversion=yes +If specified, the package version in AndroidManifest.xml is replaced +with the version number for the build as specified in recipe. Useful +for cases when upstream repo missed to update it for specific tag, +or to build an arbitrary revision. -@item insertvercode=x -If specified, the pattern 'x' in the AndroidManifest.xml is replaced -with the version code for the build. +@item forcevercode=yes +If specified, the package vercode in the AndroidManifest.xml is replaced +with the version code for the build. See also forceversion. @item update=no By default, 'android update project' is used to generate or update the diff --git a/metadata/com.google.android.diskusage.txt b/metadata/com.google.android.diskusage.txt index fb41d22a..5a2f3015 100644 --- a/metadata/com.google.android.diskusage.txt +++ b/metadata/com.google.android.diskusage.txt @@ -14,7 +14,7 @@ Repo:http://diskusage.googlecode.com/svn/trunk/ Build Version:2.0.4,2004,61,prebuild=mkdir libs && cp extra/system.jar libs/ #Note - version name/code is wrong in the repo - we replace it -Build Version:2.0.5,2005,62,prebuild=mkdir libs && cp extra/system.jar libs/,insertversion=2.0.4,insertvercode=2004 +Build Version:2.0.5,2005,62,prebuild=mkdir libs && cp extra/system.jar libs/,forceversion=yes,forcevercode=yes Build Version:2.1.3,2103,65,prebuild=mkdir libs && cp extra/system.jar libs/ Build Version:3.0alpha2,3001,!repo version incorrect,prebuild=mkdir libs && cp extra/system.jar libs/ Build Version:3.0alpha3,3005,!no source in repo,prebuild=mkdir libs && cp extra/system.jar libs/ diff --git a/metadata/org.helllabs.android.xmp.txt b/metadata/org.helllabs.android.xmp.txt index fed13459..02401be8 100644 --- a/metadata/org.helllabs.android.xmp.txt +++ b/metadata/org.helllabs.android.xmp.txt @@ -17,10 +17,10 @@ Repo Type:git Repo:git://xmp.git.sourceforge.net/gitroot/xmp/xmp # This is one of those projects that put the changelog in the version -# number, so fix that with insertversion. +# number, so fix that with forceversion. Build Version:2.1.0,15,639549fda2111cb800fabe468b4a64bf4ae27003,\ buildjni=yes,subdir=src/android/project,target=android-8,\ -insertversion=2.1.0[^"]* +forceversion=yes Update Check Mode:Market Current Version:2.4.0