Skip to content

Commit 30a4ebb

Browse files
committed
DB: in case of remote db corrompted destroy it to give a change to rebuild
Fixes: #2275
1 parent e9abac3 commit 30a4ebb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

libpkg/repo/binary/update.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,9 @@ pkg_repo_binary_update(struct pkg_repo *repo, bool force)
829829
res = pkg_repo_binary_update_proceed(filename, repo, &t, force);
830830
if (res != EPKG_OK && res != EPKG_UPTODATE) {
831831
pkg_emit_notice("Unable to update repository %s", repo->name);
832+
/* Remove potentially corrupted repo database so the
833+
* next update can start fresh */
834+
unlink(filename);
832835
goto cleanup;
833836
}
834837

0 commit comments

Comments
 (0)