From 6ce85053c512f720b7976202a7c369d8bf1dc193 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Wed, 13 Oct 2021 21:05:24 +0100 Subject: [PATCH] libalpm: allow nolock transactions when downloadonly --- lib/libalpm/trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index ae5c72ae..82181d1b 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -177,7 +177,8 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) ASSERT(trans != NULL, RET_ERR(handle, ALPM_ERR_TRANS_NULL, -1)); ASSERT(trans->state == STATE_PREPARED, RET_ERR(handle, ALPM_ERR_TRANS_NOT_PREPARED, -1)); - ASSERT(!(trans->flags & ALPM_TRANS_FLAG_NOLOCK), RET_ERR(handle, ALPM_ERR_TRANS_NOT_LOCKED, -1)); + ASSERT(!(trans->flags & ALPM_TRANS_FLAG_NOLOCK && !(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY)), + RET_ERR(handle, ALPM_ERR_TRANS_NOT_LOCKED, -1)); /* If there's nothing to do, return without complaining */ if(trans->add == NULL && trans->remove == NULL) {