FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 09-16-2012, 02:21 PM
Allan McRae
 
Default Fix for overzealous package removal with unmet dependencies

Here goes a WIP patch for FS#30649. It fixes one the sync140.py
testcase just sent to the mailing list, but not sync141.py - it works
only when the root cause of the excess dependency removal is first in
the upgraded package list.

If anyone has an idea for how to get it fully fixed, I would appreciate
the help.

Allan


diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 841e5d6..65a8f52 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -406,14 +406,29 @@ int _alpm_sync_prepare(alpm_handle_t *handle,
alpm_list_t **data)

/* Resolve packages in the transaction one at a time, in addition
building up a list of packages which could not be resolved. */
- for(i = trans->add; i; i = i->next) {
+
+ i = trans->add;
+ while(i != NULL) {
alpm_pkg_t *pkg = i->data;
if(_alpm_resolvedeps(handle, localpkgs, pkg, trans->add,
&resolved, remove, data) == -1) {
unresolvable = alpm_list_add(unresolvable, pkg);
+
+ /* remove the unresolvable package from the upgrade
+ list and recalculate localpkgs to allow the a local
+ version to satisfy future deps */
+
+ i = i->next;
+ trans->add = alpm_list_remove(trans->add, pkg,
+ _alpm_pkg_cmp, NULL);
+ localpkgs = alpm_list_diff(
+ _alpm_db_get_pkgcache(handle->db_local),
+ trans->add, _alpm_pkg_cmp);
+ } else {
+ /* [resolved] now additionally contains [pkg] and all of its
+ dependencies not already on the list */
+ i = i->next;
}
- /* Else, [resolved] now additionally contains [pkg] and all of its
- dependencies not already on the list */
}
alpm_list_free(localpkgs);
alpm_list_free(remove);
 

Thread Tools




All times are GMT. The time now is 01:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org