mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Allow rm to recursively remove directories
This commit is contained in:
parent
b556693d4a
commit
921b407582
2 changed files with 11 additions and 8 deletions
|
@ -1424,12 +1424,14 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path,
|
|||
path]) != 0:
|
||||
raise BuildException("Failed to amend manifest")
|
||||
|
||||
# Delete unwanted file...
|
||||
# Delete unwanted files...
|
||||
if 'rm' in build:
|
||||
for part in build['rm'].split(';'):
|
||||
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):
|
||||
os.remove(dest)
|
||||
subprocess.call('rm -rf ' + dest, shell=True)
|
||||
|
||||
# Fix apostrophes translation files if necessary...
|
||||
if build.get('fixapos', 'no') == 'yes':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue