dist/debian/debian_files_gen.py: don't ignore permission error on shutil.rmtree()

shutil.rmtree(ignore_errors=True) was for ignores error when directory not exist,
but it also ignores permission error, so we shouldn't use that.
Run os.path.exists() before shutil.rmtree() instead.

See scylladb/scylla#7337
This commit is contained in:
Takuya ASADA 2020-10-06 03:45:08 +09:00 committed by Pekka Enberg
parent e3a381d5a1
commit c55f3f292b

View File

@ -46,7 +46,8 @@ with open('build/SCYLLA-VERSION-FILE') as f:
with open('build/SCYLLA-RELEASE-FILE') as f:
release = f.read().strip()
shutil.rmtree('build/debian/debian', ignore_errors=True)
if os.path.exists('build/debian/debian'):
shutil.rmtree('build/debian/debian')
shutil.copytree('dist/debian/debian', 'build/debian/debian')
if product != 'scylla':