mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
Allow rm to recursively remove directories
This commit is contained in:
parent
b556693d4a
commit
921b407582
@ -840,14 +840,15 @@ which architecture or platform the apk is designed to run on.
|
|||||||
If specified, the package version code in the AndroidManifest.xml is
|
If specified, the package version code in the AndroidManifest.xml is
|
||||||
replaced with the version code for the build. See also forceversion.
|
replaced with the version code for the build. See also forceversion.
|
||||||
|
|
||||||
@item rm=<relpath>
|
@item rm=<relpath1;relpath2;...>
|
||||||
Specifies the relative path of a file to delete before the build is
|
Specifies the relative paths of files or directories to delete before
|
||||||
done. The path is relative to the base of the build directory - i.e.
|
the build is done. The paths are relative to the base of the build
|
||||||
the root of the directory structure checked out from the source
|
directory - i.e. the root of the directory structure checked out from
|
||||||
respository - not necessarily the directory that contains
|
the source respository - not necessarily the directory that contains
|
||||||
AndroidManifest.xml.
|
AndroidManifest.xml.
|
||||||
|
|
||||||
Multiple files can be specified by separating they with ';'.
|
Multiple files/directories can be specified by separating them with ';'.
|
||||||
|
Directories will be recursively deleted.
|
||||||
|
|
||||||
@item fixtrans=yes
|
@item fixtrans=yes
|
||||||
Modifies any instances of string resources that use multiple
|
Modifies any instances of string resources that use multiple
|
||||||
|
@ -1424,12 +1424,14 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path,
|
|||||||
path]) != 0:
|
path]) != 0:
|
||||||
raise BuildException("Failed to amend manifest")
|
raise BuildException("Failed to amend manifest")
|
||||||
|
|
||||||
# Delete unwanted file...
|
# Delete unwanted files...
|
||||||
if 'rm' in build:
|
if 'rm' in build:
|
||||||
for part in build['rm'].split(';'):
|
for part in build['rm'].split(';'):
|
||||||
dest = os.path.join(build_dir, part.strip())
|
dest = os.path.join(build_dir, part.strip())
|
||||||
|
if not os.path.realpath(dest).startswith(os.path.realpath(root_dir)):
|
||||||
|
raise BuildException("rm is outside build root")
|
||||||
if os.path.exists(dest):
|
if os.path.exists(dest):
|
||||||
os.remove(dest)
|
subprocess.call('rm -rf ' + dest, shell=True)
|
||||||
|
|
||||||
# Fix apostrophes translation files if necessary...
|
# Fix apostrophes translation files if necessary...
|
||||||
if build.get('fixapos', 'no') == 'yes':
|
if build.get('fixapos', 'no') == 'yes':
|
||||||
|
Loading…
Reference in New Issue
Block a user