Compare commits

..

1 Commits

Author SHA1 Message Date
Andrew Gregory
448b43a5d2 allow committing transaction without a lock file
This is useful to allow front-ends to manage the lock file themselves,
allowing them to ensure database consistency across multiple commands, e.g.:

 paclock --lock
 pacinstall --no-lock foo
 # foo is guaranteed to be installed until the db is unlocked
 paclock --unlock

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2024-03-12 08:23:12 -07:00
3 changed files with 3 additions and 5 deletions

View File

@@ -177,8 +177,6 @@ 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));
/* If there's nothing to do, return without complaining */
if(trans->add == NULL && trans->remove == NULL) {
return 0;

View File

@@ -605,8 +605,8 @@ trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT
trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR
OPT_SHORT="k:npqRsv"
OPT_LONG=('include-sigs' 'key:' 'new' 'nocolor' 'quiet' 'prevent-downgrade' 'remove'
OPT_SHORT="knpqRsv"
OPT_LONG=('include-sigs' 'key' 'new' 'nocolor' 'quiet' 'prevent-downgrade' 'remove'
'sign' 'verify')
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
exit 1 # E_INVALID_OPTION

View File

@@ -140,7 +140,7 @@ static void make_aligned_titles(void)
size_t padlen = maxcol - wcol[i];
wmemset(wbuf[i] + wlen[i], L' ', padlen);
wmemcpy(wbuf[i] + wlen[i] + padlen, title_suffix, ARRAYSIZE(title_suffix));
wcstombs(titles[i], wbuf[i], sizeof(titles[i]));
wcstombs(titles[i], wbuf[i], sizeof(wbuf[i]));
}
}