Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-09-19 13:18:42 -0500
committerDan McGee <dan@archlinux.org>2011-09-19 13:18:42 -0500
commite1899cbc64c6b634107f09c3a3e8152c63078636 (patch)
treede6bd009664fc863f3f997cf4a78f2d75a9c2e5b /lib/libalpm/remove.c
parenta94ad2974031138dbb4d42a939dfc0cd15a75ce7 (diff)
Be smarter about running ldconfig during removal transactions
1. Don't run it if something failed in package removal- this mirrors what we already do in sync transactions. 2. Don't run it if we are invoking it for the replaces removal bit of a sync transaction- it doesn't make sense to run ldconfig halfway through a sync install; we should only run it once at the end. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index c6a3efcb..e998763f 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -475,7 +475,7 @@ db:
return 0;
}
-int _alpm_remove_packages(alpm_handle_t *handle)
+int _alpm_remove_packages(alpm_handle_t *handle, int run_ldconfig)
{
alpm_list_t *targ;
size_t pkg_count, targ_count;
@@ -489,23 +489,25 @@ int _alpm_remove_packages(alpm_handle_t *handle)
alpm_pkg_t *pkg = targ->data;
if(trans->state == STATE_INTERRUPTED) {
- return 0;
+ return ret;
}
if(_alpm_remove_single_package(handle, pkg, NULL,
targ_count, pkg_count) == -1) {
handle->pm_errno = ALPM_ERR_TRANS_ABORT;
+ /* running ldconfig at this point could possibly screw system */
+ run_ldconfig = 0;
ret = -1;
- goto cleanup;
}
targ_count++;
}
- /* run ldconfig if it exists */
- _alpm_ldconfig(handle);
+ if(run_ldconfig) {
+ /* run ldconfig if it exists */
+ _alpm_ldconfig(handle);
+ }
-cleanup:
return ret;
}