From 61787e30d926a16baa2fd56bffd197dade7bf5e5 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 5 Apr 2019 17:39:09 +0800 Subject: [PATCH] repo.py: allow overwrite old archive --- repo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repo.py b/repo.py index 4ed0f2f..4536308 100755 --- a/repo.py +++ b/repo.py @@ -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)