Add the --include-masked flag when calling the equery which command.

When setting up a new ebuild, the process I've used in the past was to
create a 9999 ebuild and, to test it, cros_workon it so emerge can
choose that version to build. cros_workon uses equery in its
canonicalize_name function, and if it fails then it aborts the call to,
in my case, cros_workon start.

The problem is that equery ignores masked packages by default,
apparently, and because no stable version exists, it can't see the lone
9999 ebuild. Because that fails you can't cros_workon the package, and
because of that you can't build it because you've still only got the
unstable version.

To work around this new behavior, I added the --include-masked option I
found while digging around in equery's source. This option seems to
allow it to see the otherwise unavailable package, and the cros_workon
succeeds.

BUG=None
TEST=Saw that this allowed cros_workon-ing a new ebuild which only had a
9999 version. Ran cros_workon-link start and stop on an existing ebuild
and saw the command complete successfully.

Change-Id: Icfb271ed671b118bbd4ebfa1c3341353e203162a
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/42276
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
This commit is contained in:
Gabe Black 2013-01-29 17:49:55 -08:00 committed by ChromeBot
parent 45ebc4c9fc
commit 0d7b85aacd

View File

@ -177,7 +177,8 @@ canonicalize_name () {
return 0
fi
if ! pkgfile=$(ACCEPT_KEYWORDS="~${ARCH}" ${EQUERYCMD} which $1); then
if ! pkgfile=$(ACCEPT_KEYWORDS="~${ARCH}" ${EQUERYCMD} \
which --include-masked $1); then
warn "error looking up package $1" 1>&2
return 1
fi