summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-12-01 10:32:29 +0100
committerAaron Griffin <aaron@archlinux.org>2006-12-01 10:32:29 +0100
commit08dca1593f82dfa4b5f1199b5b1f4d7099719be9 (patch)
treeb1b383f93524ebfcb5bfcc98924668f29dc88ba3 /lib/libalpm/alpm.c
parent6c68723905ba1d8cee83e4af88b0ac8ee9a408aa (diff)
downloadpacman-08dca1593f82dfa4b5f1199b5b1f4d7099719be9.tar.gz
pacman-08dca1593f82dfa4b5f1199b5b1f4d7099719be9.tar.xz
* Cosmetic changes and typo fixes
* IgnorePkg and --ignore work again * Partial changes to support removal of conflicts for -U and -A (INCOMPLETE)
Diffstat (limited to 'lib/libalpm/alpm.c')
-rw-r--r--lib/libalpm/alpm.c9
1 files changed, 7 insertions, 2 deletions
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);