summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-03-03 20:22:48 +0000
committerDan McGee <dan@archlinux.org>2007-03-03 20:22:48 +0000
commitfd2167131f84d35ada14e36be73ca6b266901acd (patch)
tree6e0b4356be2fb4f9a0231af529f518136a09d01c /lib/libalpm
parent0af3c4e85e5b35c049393c270f37853c4d443321 (diff)
* Remove unnecessary call to _alpm_trans_update_depends that was erroring
anyway. * Spelling/commenting etc.
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c2
-rw-r--r--lib/libalpm/conflict.c2
-rw-r--r--lib/libalpm/remove.c31
3 files changed, 21 insertions, 14 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 64686ed2..a5fc6fb9 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -402,7 +402,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
alpm_list_t *old_noupgrade = alpm_list_strdup(handle->noupgrade);
for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
const char *backup = b->data;
- _alpm_log(PM_LOG_DEBUG, _("adding %s to the NoUpgrade array temporarilly"), backup);
+ _alpm_log(PM_LOG_DEBUG, _("adding %s to the NoUpgrade array temporarily"), backup);
handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(backup));
}
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 96c0ac84..76e76901 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -244,11 +244,13 @@ alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages)
continue;
}
+ /* run three different conflict checks on each package */
baddeps = chk_pkg_vs_db(baddeps, pkg, db);
baddeps = chk_pkg_vs_targets(baddeps, pkg, db, packages);
baddeps = chk_db_vs_targets(baddeps, pkg, db, packages);
}
+ /* debug loop */
for(i = baddeps; i; i = i->next) {
pmdepmissing_t *miss = i->data;
_alpm_log(PM_LOG_DEBUG, _("\tCONFLICTS:: %s conflicts with %s"), miss->target, miss->depend.name);
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 68900b5f..84908580 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -277,22 +277,26 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
char pm_install[PATH_MAX];
alpm_list_t *files;
info = (pmpkg_t*)targ->data;
+ const char *pkgname = NULL;
if(handle->trans->state == STATE_INTERRUPTED) {
break;
}
+ /* get the name now so we can use it after package is removed */
+ pkgname = alpm_pkg_get_name(info);
+
if(trans->type != PM_TRANS_TYPE_UPGRADE) {
EVENT(trans, PM_TRANS_EVT_REMOVE_START, info, NULL);
_alpm_log(PM_LOG_DEBUG, _("removing package %s-%s"),
- alpm_pkg_get_name(info), alpm_pkg_get_version(info));
+ pkgname, alpm_pkg_get_version(info));
/* run the pre-remove scriptlet if it exists */
if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
snprintf(pm_install, PATH_MAX, "%s/%s-%s/install", db->path,
- alpm_pkg_get_name(info), alpm_pkg_get_version(info));
+ pkgname, alpm_pkg_get_version(info));
_alpm_runscriptlet(handle->root, pm_install, "pre_remove",
- alpm_pkg_get_version(info), NULL, trans);
+ alpm_pkg_get_version(info), NULL, trans);
}
}
@@ -302,7 +306,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
for(lp = files; lp; lp = lp->next) {
if(!can_remove_file(trans, lp->data)) {
_alpm_log(PM_LOG_DEBUG, _("not removing package '%s', can't remove all files"),
- alpm_pkg_get_name(info));
+ pkgname);
RET_ERR(PM_ERR_PKG_CANT_REMOVE, -1);
}
}
@@ -320,7 +324,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
/* run the post-remove script if it exists */
if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
snprintf(pm_install, PATH_MAX, "%s/%s-%s/install", db->path,
- alpm_pkg_get_name(info), alpm_pkg_get_version(info));
+ pkgname, alpm_pkg_get_version(info));
_alpm_runscriptlet(handle->root, pm_install, "post_remove",
alpm_pkg_get_version(info), NULL, trans);
}
@@ -328,19 +332,20 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
/* remove the package from the database */
_alpm_log(PM_LOG_DEBUG, _("updating database"));
- _alpm_log(PM_LOG_DEBUG, _("removing database entry '%s'"), alpm_pkg_get_name(info));
+ _alpm_log(PM_LOG_DEBUG, _("removing database entry '%s'"), pkgname);
if(_alpm_db_remove(db, info) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not remove database entry %s-%s"),
- alpm_pkg_get_name(info), alpm_pkg_get_version(info));
+ pkgname, alpm_pkg_get_version(info));
}
+ /* remove the package from the cache */
if(_alpm_db_remove_pkgfromcache(db, info) == -1) {
- _alpm_log(PM_LOG_ERROR, _("could not remove entry '%s' from cache"), alpm_pkg_get_name(info));
+ _alpm_log(PM_LOG_ERROR, _("could not remove entry '%s' from cache"),
+ pkgname);
}
-
- /* update dependency packages' REQUIREDBY fields */
- _alpm_trans_update_depends(trans, info);
-
- PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, alpm_pkg_get_name(info), 100, alpm_list_count(trans->packages), (alpm_list_count(trans->packages) - alpm_list_count(targ) +1));
+
+ PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, pkgname, 100,
+ alpm_list_count(trans->packages),
+ (alpm_list_count(trans->packages) - alpm_list_count(targ) +1));
if(trans->type != PM_TRANS_TYPE_UPGRADE) {
EVENT(trans, PM_TRANS_EVT_REMOVE_DONE, info, NULL);
}