diff options
-rw-r--r-- | lib/libalpm/be_sync.c | 3 | ||||
-rw-r--r-- | lib/libalpm/util.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 06f509a6..46959298 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -486,6 +486,9 @@ static int sync_db_populate(alpm_db_t *db) fd = _alpm_open_archive(db->handle, dbpath, &buf, &archive, ALPM_ERR_DB_OPEN); if(fd < 0) { + if(db->handle->pm_errno == ALPM_ERR_DB_INVALID) { + db->status &= DB_STATUS_INVALID; + } return -1; } est_count = estimate_package_count(&buf, archive); diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 35fc7f41..0fb9bb6d 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -268,6 +268,7 @@ int _alpm_open_archive(alpm_handle_t *handle, const char *path, if(archive_read_open_fd(*archive, fd, bufsize) != ARCHIVE_OK) { _alpm_log(handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), path, archive_error_string(*archive)); + error = ALPM_ERR_DB_INVALID; goto error; } |