devserver: fix dbtree lookups with newer portage

Older portage versions would return plain strings with the dbapi which
made them safe to pass directly into diff bintrees.  Newer portage now
returns pkg_str which are strings with build metadata attached to them.
When doing bintree lookups, that metadata, if present, is used to look
up further results.  If it isn't present, it falls back to treating it
like a plain string.

That means if we try to use a result from one bintree to locate data in
another bintree (like we do with bintree and the gmerge_tree bintrees),
the match will fail if the binpkgs don't match exactly.  Which they don't
because we've explicitly modified them in the gmerge_tree.

Address this by normalizing all matches from the different trees into
plain strings.  This lets the bintree lookup the extra metadata on the
fly when it doesn't exist.

TEST=precq passes

Change-Id: Ie3f4202e60d28095ffbc674d357c58275022470e
Commit-Ready: Mike Frysinger <>
Tested-by: Mike Frysinger <>
Reviewed-by: Chirantan Ekbote <>
1 file changed