mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 15:32:30 +03:00
Merge branch 'no_rm' into 'master'
common: use python instead of calling out to 'rm' See merge request fdroid/fdroidserver!381
This commit is contained in:
commit
a3815039d8
1 changed files with 4 additions and 3 deletions
|
@ -1612,10 +1612,11 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
|
||||||
dest = os.path.join(build_dir, part)
|
dest = os.path.join(build_dir, part)
|
||||||
logging.info("Removing {0}".format(part))
|
logging.info("Removing {0}".format(part))
|
||||||
if os.path.lexists(dest):
|
if os.path.lexists(dest):
|
||||||
if os.path.islink(dest):
|
# rmtree can only handle directories that are not symlinks, so catch anything else
|
||||||
FDroidPopen(['unlink', dest], output=False)
|
if not os.path.isdir(dest) or os.path.islink(dest):
|
||||||
|
os.remove(dest)
|
||||||
else:
|
else:
|
||||||
FDroidPopen(['rm', '-rf', dest], output=False)
|
shutil.rmtree(dest)
|
||||||
else:
|
else:
|
||||||
logging.info("...but it didn't exist")
|
logging.info("...but it didn't exist")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue