From f45369800abdeb54847d9ea6a326eb613f30cd3b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 28 Feb 2011 10:46:00 -0600 Subject: Check local DB version before continuing transaction Ensure we have a local DB version that is up to par with what we expect before we go down any road that might modify it. This should prevent stupid mistakes with the 3.5.X upgrade and people not running pacman-db-upgrade after the transaction as they will need to. Signed-off-by: Dan McGee --- lib/libalpm/be_sync.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/libalpm/be_sync.c') diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 69f7663d..21914944 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -443,9 +443,15 @@ error: return(0); } +static int sync_db_version(pmdb_t *db) +{ + return(2); +} + struct db_operations sync_db_ops = { .populate = sync_db_populate, .unregister = _alpm_db_unregister, + .version = sync_db_version, }; pmdb_t *_alpm_db_register_sync(const char *treename) -- cgit v1.2.3-24-g4f1b