From 08dca1593f82dfa4b5f1199b5b1f4d7099719be9 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 1 Dec 2006 09:32:29 +0000 Subject: * Cosmetic changes and typo fixes * IgnorePkg and --ignore work again * Partial changes to support removal of conflicts for -U and -A (INCOMPLETE) --- lib/libalpm/alpm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/alpm.c') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 1bda976c..a7fb0a99 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -261,8 +261,13 @@ int alpm_db_update(int force, pmdb_t *db) /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1)); - /* Do not update a database if a transaction is on-going */ - ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1)); + /* Verify we are in a transaction. This is done _mainly_ because we need a DB + * lock - if we update without a db lock, we may kludge some other pacman + * process that _has_ a lock. + */ + ASSERT(handle->trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); + ASSERT(handle->trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1)); + ASSERT(handle->trans->type == PM_TRANS_TYPE_SYNC, RET_ERR(PM_ERR_TRANS_TYPE, -1)); if(!_alpm_list_is_in(db, handle->dbs_sync)) { RET_ERR(PM_ERR_DB_NOT_FOUND, -1); -- cgit v1.2.3-24-g4f1b