Add a new portageq helper to reduce a string containing use conditionals

BUG=chromium:331853
TEST=verify autotest ebuild still build tests

https://chromium-review.googlesource.com/181876

Change-Id: I6c1cee0902bce794872e459ec82167d21e50e75b
Reviewed-on: https://chromium-review.googlesource.com/214528
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
diff --git a/bin/portageq b/bin/portageq
index 79818f6..332122f 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1117,6 +1117,17 @@
 	return os.EX_OK
 
 
+def use_reduce(argv):
+	"""<depend_string>
+	Reduce a dependency string possibly containing use conditionals.
+	"""
+
+	if len(argv) != 1:
+		print("ERROR: wrong number of arguments")
+		return 2
+	from portage.dep import use_reduce as use_internal
+	print(' '.join(use_internal(argv[0], uselist=os.environ['USE'].split(' '))))
+
 #-----------------------------------------------------------------------------
 #
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!