Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 524916

Summary: --onlydeps does not work when this_package:this_slot has DEPEND="|| ( other_package this_package:this_slot )" and this_package:other_slot is installed
Product: Portage Development Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra
Priority: Normal Keywords: InVCS, PATCH
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=294719
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 484436    
Attachments: dep_zapdeps: handle circular deps with --onlydeps

Description Arfrever Frehtes Taifersar Arahesis 2014-10-10 01:51:07 UTC
I use Portage trunk (2.2.13_p27, 02ed485976fbf88a548c7b83978e23e3b50f41a2).

# cat app-misc/A/A-1.ebuild
EAPI="5"
SLOT="1"
KEYWORDS="*"
DEPEND="|| ( app-misc/B app-misc/A:1 )"
# cat app-misc/A/A-2.ebuild
EAPI="5"
SLOT="2"
KEYWORDS="*"
# cat app-misc/B/B-0.ebuild
EAPI="5"
SLOT="0"
KEYWORDS="*"
# emerge -optv app-misc/A:1

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[nomerge       ] app-misc/A-1:1::local 
[ebuild  N     ]  app-misc/B-0::local  0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB
# emerge -1 app-misc/A:2
...
# emerge -optv app-misc/A:1

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild  NS    ] app-misc/A-1:1::local [2:2::local] 0 KiB
[ebuild  N     ]  app-misc/B-0::local  0 KiB

Total: 2 packages (1 new, 1 in new slot), Size of downloads: 0 KiB
Comment 1 Zac Medico gentoo-dev 2014-10-27 01:41:27 UTC
I have a unit test based on comment #0 that reproduces this bug:

	https://github.com/zmedico/portage/tree/bug_524916
Comment 2 Zac Medico gentoo-dev 2014-10-27 22:06:45 UTC
Created attachment 387600 [details, diff]
dep_zapdeps: handle circular deps with --onlydeps

This fixes a case with --onlydeps were dep_zapdeps would pull in an avoidable direct circular dependency on an onlydeps node. The logic changes only apply to --onlydeps, so there's no chance of regressions for cases when --onlydeps is not enabled.
Comment 4 Arfrever Frehtes Taifersar Arahesis 2015-01-02 05:21:13 UTC
Fixed in Portage 2.2.15.