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/db.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/db.h') diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index a530a2e9..75776d71 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -45,6 +45,7 @@ typedef enum _pmdbinfrq_t { struct db_operations { int (*populate) (pmdb_t *); void (*unregister) (pmdb_t *); + int (*version) (pmdb_t *); }; /* Database */ @@ -65,14 +66,15 @@ struct __pmdb_t { /* db.c, database general calls */ +pmdb_t *_alpm_db_new(const char *treename, int is_local); void _alpm_db_free(pmdb_t *db); const char *_alpm_db_path(pmdb_t *db); +int _alpm_db_version(pmdb_t *db); int _alpm_db_cmp(const void *d1, const void *d2); alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles); pmdb_t *_alpm_db_register_local(void); pmdb_t *_alpm_db_register_sync(const char *treename); void _alpm_db_unregister(pmdb_t *db); -pmdb_t *_alpm_db_new(const char *treename, int is_local); /* be_*.c, backend specific calls */ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); -- cgit v1.2.3-24-g4f1b