repo.py: allow overwrite old archive

This commit is contained in:
JerryXiao 2019-04-05 17:39:09 +08:00
parent df266b9ace
commit 61787e30d9
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA

View file

@ -98,7 +98,9 @@ def archive_pkg(fpath):
throw_away(fpath)
return
newPath = Path('archive') / fpath.name
assert not newPath.exists()
if newPath.exists():
logger.warning(f'Removing old archive {newPath}')
throw_away(newPath)
logger.warning('Archiving %s', fpath)
fpath.rename(newPath)