1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-16 14:25:21 -05:00
pacman/lib/libalpm
Chantry Xavier b0aa510592 trans.c : reworking of transaction interruptions
My two previous hacks related to this part
(8038190c7c and
b15a5194d1) were caused by the lack of
understanding of a feature introduced a while ago:
Better control over CTRL-C interruptions -- do not leave the DB in an
inconsistent state (54008798ef).

Now I have been looking at this commit, and the added feature is indeed
interesting. The main problem I had with it is that it does a rather
unusual use of alpm_trans_release, which caused a few problems that I tried
to fix in a weird way. I think these problems were caused by the fact that
there weren't any difference between "interrupt transaction" and "release a
transaction which failed" actions from the alpm_trans_release POV.  So I
decided to add a new function instead, alpm_trans_interrupt, which is
called on Ctrl+C, and which only sets trans->state to STATE_INTERRUPTED so
that remove_commit and add_commit can exit cleanly at a safe moment. This
allowed me to revert my two previous hacks as well.

Also ensure we handle SIGINT correctly in all cases- if a transaction is
not ongoing, then we can free the transaction and exit quickly.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-16 20:17:44 -05:00
..
po libalpm: remove outdated files from POTFILES.in 2007-09-04 07:12:57 -05:00
.gitignore Remove unnecessary entries from .gitignore files 2007-07-16 16:49:28 -04:00
add.c trans.c : reworking of transaction interruptions 2007-09-16 20:17:44 -05:00
add.h Preliminary checkin for alpm_list conversion 2007-01-19 09:28:44 +00:00
alpm_list.c libalpm/alpm_list.c : add SYMEXPORT to all alpm_list_ functions. 2007-07-20 10:28:07 -04:00
alpm_list.h Const correctness! 2007-06-05 17:34:33 -04:00
alpm.c libalpm/db.c : add alpm_db_unregister_all. 2007-08-16 11:08:17 -04:00
alpm.h trans.c : reworking of transaction interruptions 2007-09-16 20:17:44 -05:00
backup.c Remove support for SHA1 from pacman. 2007-08-16 11:30:38 -04:00
backup.h Const correctness! 2007-06-05 17:34:33 -04:00
be_files.c Remove the DB consistency check from pacman and libalpm. 2007-09-16 20:10:18 -05:00
cache.c libalpm: add newlines to all strings passed to log callback 2007-08-23 22:26:55 -04:00
cache.h Big commit this time: 2007-03-03 08:13:59 +00:00
conflict.c libalpm: add newlines to all strings passed to log callback 2007-08-23 22:26:55 -04:00
conflict.h This commit looks much more monumental than it is. Almost all just #include 2007-03-05 22:13:33 +00:00
db.c trans.c : reworking of transaction interruptions 2007-09-16 20:17:44 -05:00
db.h Remove the DB consistency check from pacman and libalpm. 2007-09-16 20:10:18 -05:00
deps.c libalpm/deps.c : export _alpm_checkdeps (-> alpm_checkdeps). 2007-09-11 20:42:03 -05:00
deps.h libalpm/deps.c : cleanup + little fix for resolvedeps. 2007-07-15 10:37:38 -04:00
error.c make alpm_strerror binding friendly 2007-09-11 20:58:27 -05:00
error.h make alpm_strerror binding friendly 2007-09-11 20:58:27 -05:00
group.c libalpm: add newlines to all strings passed to log callback 2007-08-23 22:26:55 -04:00
group.h Remove FREEGRP macro and correctly type _alpm_grp_free 2007-04-27 20:38:54 -04:00
handle.c libalpm: add newlines to all strings passed to log callback 2007-08-23 22:26:55 -04:00
handle.h Clean up the alpm handle 2007-07-09 15:23:26 -04:00
log.c Clean up the alpm handle 2007-07-09 15:23:26 -04:00
log.h Remove logmask stuff from backend; switch logging callback to new pm_printf 2007-06-09 12:57:50 -04:00
Makefile.am Clean up MD5 code. 2007-08-16 13:17:33 -04:00
md5.c Add const qualifier to md5_file and alpm_get_md5sum 2007-08-20 12:58:17 -04:00
md5.h Add const qualifier to md5_file and alpm_get_md5sum 2007-08-20 12:58:17 -04:00
package.c libalpm/package.c : add new alpm_pkg_compute_requiredby function. 2007-09-11 20:41:54 -05:00
package.h Remove support for SHA1 from pacman. 2007-08-16 11:30:38 -04:00
provide.c This commit looks much more monumental than it is. Almost all just #include 2007-03-05 22:13:33 +00:00
provide.h * Enforce const char* params when using strings 2007-02-26 08:38:48 +00:00
remove.c trans.c : reworking of transaction interruptions 2007-09-16 20:17:44 -05:00
remove.h Preliminary checkin for alpm_list conversion 2007-01-19 09:28:44 +00:00
server.c libalpm: add newlines to all strings passed to log callback 2007-08-23 22:26:55 -04:00
server.h Fix for FS 6404 and functionalize some cachedir handling stuff 2007-08-20 15:23:46 -04:00
sync.c libalpm: add newlines to all strings passed to log callback 2007-08-23 22:26:55 -04:00
sync.h Remove FREESYNC macro and correctly type _alpm_sync_free 2007-04-27 14:53:01 -04:00
trans.c trans.c : reworking of transaction interruptions 2007-09-16 20:17:44 -05:00
trans.h Fix some errors spit out by -Wextra 2007-08-16 16:19:06 -04:00
util.c libalpm: add newlines to all strings passed to log callback 2007-08-23 22:26:55 -04:00
util.h Add a few missing includes, caught while compiling on cygwin 2007-09-06 19:03:38 -05:00