Using sys-apps/portage-2.3.49-r27:0, I'm seeing "emerge --onlydeps --onlydeps-with-rdeps=n" unexpectedly match RDEPEND dependencies if the target package is already installed. If the target package is not installed, it only matches DEPEND dependencies (as I would expect). To demonstrate the issue, I defined three packages: chromeos-base/deps-example/deps-example-9999.ebuild: EAPI=5 DESCRIPTION="Base package demonstrating RDEPEND issue" LICENSE="BSD" KEYWORDS="*" SLOT="0" DEPEND="chromeos-base/deps-example-dep" RDEPEND="chromeos-base/deps-example-rdep" chromeos-base/deps-example/deps-example-dep-9999.ebuild: EAPI=5 DESCRIPTION="Build-time dependency demonstrating RDEPEND issue" LICENSE="BSD" KEYWORDS="*" SLOT="0" chromeos-base/deps-example-rdep/deps-example-rdep-9999.ebuild: EAPI=5 DESCRIPTION="Runtime dependency demonstrating RDEPEND issue" LICENSE="BSD" KEYWORDS="*" SLOT="0" Initially, I see the expected output, i.e. only the DEPEND package is printed: $ emerge --onlydeps --onlydeps-with-rdeps=n --update --deep 1 --pretend --quiet y =chromeos-base/deps-example-9999 [ebuild N ] chromeos-base/deps-example-dep-9999 If I emerge deps-example (which also emerges both of the dependencies) and then run "emerge -C deps-example-rdep deps-example-dep" to produce missing dependencies, then the same command lists both the DEPEND and RDEPEND packages: $ emerge --onlydeps --onlydeps-with-rdeps=n --update --deep 1 --pretend --quiet y =chromeos-base/deps-example-9999 [ebuild N ] chromeos-base/deps-example-rdep-9999 [ebuild N ] chromeos-base/deps-example-dep-9999 --onlydeps-with-rdeps=n seems to be ignored in this case. After uninstalling deps-example, I again see only the DEPEND package printed: $ emerge --onlydeps --onlydeps-with-rdeps=n --update --deep 1 --pretend --quiet y =chromeos-base/deps-example-9999 [ebuild N ] chromeos-base/deps-example-dep-9999 I see the unexpected behavior if the RDEPEND package is installed but outdated -- it gets printed if deps-example is installed even though --onlydeps-with-rdeps=n should be excluding it.
This only appears to happen when --update is supplied: $ equery l 'deps-example*' * Searching for deps-example* ... [I-O] [ ] chromeos-base/deps-example-9999:0 $ emerge --onlydeps --onlydeps-with-rdeps=n --deep 1 --pretend --quiet y =chromeos-base/deps-example-9999 [ebuild N ] chromeos-base/deps-example-dep-9999 In other words, --update seems to cause --onlydeps-with-rdeps=n (at least, as I understand it) to be ignored.