Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 104965 Details for
Bug 159360
latest 2.1.2's get confused on multiple (virtual) deps
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
always select the highest available new-style virtual
best_available.patch (text/plain), 3.30 KB, created by
Zac Medico
on 2006-12-29 18:30:07 UTC
(
hide
)
Description:
always select the highest available new-style virtual
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2006-12-29 18:30:07 UTC
Size:
3.30 KB
patch
obsolete
>Index: pym/portage.py >=================================================================== >--- pym/portage.py (revision 5418) >+++ pym/portage.py (revision 5419) >@@ -3945,6 +3945,7 @@ > # d) is the first item > > preferred = [] >+ possible_upgrades = [] > other = [] > > # Alias the trees we'll be checking availability against >@@ -3983,17 +3984,19 @@ > # an installed package. If they will then don't prefer them > # over other atoms. > is_downgrade = False >- if all_installed and all_available: >+ versions = {} >+ if all_installed or all_available: > for atom in atoms: > mykey = dep_getkey(atom) >+ avail_pkg = best(mydbapi.match(atom)) >+ if not avail_pkg: >+ continue >+ avail_slot = mydbapi.aux_get(avail_pkg, ["SLOT"])[0] >+ versions["%s:%s" % (mykey, avail_slot)] = avail_pkg >+ avail_split = catpkgsplit(avail_pkg)[1:] > inst_pkgs = vardb.match(mykey) > if not inst_pkgs: >- # This must be a new-style virtual that isn't really >- # installed yet (they have zero cost to install). > continue >- avail_pkg = best(mydbapi.match(atom)) >- avail_slot = mydbapi.aux_get(avail_pkg, ["SLOT"])[0] >- avail_split = catpkgsplit(avail_pkg)[1:] > for pkg in inst_pkgs: > if avail_slot != vardb.aux_get(pkg, ["SLOT"])[0]: > continue >@@ -4003,11 +4006,45 @@ > if is_downgrade: > break > >- if all_installed and not is_downgrade: >- preferred.append((atoms, all_available)) >- else: >- other.append((atoms, all_available)) >+ this_choice = (atoms, versions, all_available) >+ if not is_downgrade: >+ if all_installed: >+ preferred.append(this_choice) >+ continue >+ elif all_available: >+ possible_upgrades.append(this_choice) >+ continue >+ other.append(this_choice) > >+ # Compare the "all_installed" choices against the "all_available" choices >+ # for possible missed upgrades. The main purpose of this code is to find >+ # upgrades of new-style virtuals since _expand_new_virtuals() expands them >+ # into || ( highest version ... lowest version ). We want to prefer the >+ # highest all_available version of the new-style virtual when there is a >+ # lower all_installed version. >+ for possible_upgrade in list(possible_upgrades): >+ atoms, versions, all_available = possible_upgrade >+ myslots = set(versions) >+ for other_choice in preferred: >+ o_atoms, o_versions, o_all_available = other_choice >+ intersecting_slots = myslots.intersection(o_versions) >+ if not intersecting_slots: >+ continue >+ is_downgrade = False >+ for myslot in intersecting_slots: >+ myversion = versions[myslot] >+ o_version = o_versions[myslot] >+ if myversion != o_version and \ >+ o_version == best([myversion, o_version]): >+ is_downgrade = True >+ break >+ if not is_downgrade: >+ o_index = preferred.index(other_choice) >+ preferred.insert(o_index, possible_upgrade) >+ possible_upgrades.remove(possible_upgrade) >+ break >+ preferred.extend(possible_upgrades) >+ > # preferred now contains a) and c) from the order above with > # the masked flag differentiating the two. other contains b) > # and d) so adding other to preferred will give us a suitable >@@ -4015,7 +4052,7 @@ > preferred.extend(other) > > for allow_masked in (False, True): >- for atoms, all_available in preferred: >+ for atoms, versions, all_available in preferred: > if all_available or allow_masked: > return atoms >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 159360
: 104965