variant: check for gen_config on the PATH before running

This ensures that gen_config is available before the script runs, and
fails with instructions for adding it if it is not available.

TEST=remove gen_config from path and run directly,
  then again after adding to path with the instructions from the script.

Change-Id: I39f684d24ffdd0205652f7c3d900621f88f28bb3
Reviewed-by: Paul Fagerburg <>
Commit-Queue: Matthew Ziegelbaum <>
Tested-by: Matthew Ziegelbaum <>
diff --git a/contrib/variant/ b/contrib/variant/
index e07af62..de5e601 100755
--- a/contrib/variant/
+++ b/contrib/variant/
@@ -14,6 +14,13 @@
   exit 1
+if ! hash gen_config 2>/dev/null; then
+  echo "gen_config is not on your PATH."
+  echo "Run the following before continuing:"
+  echo "echo 'export PATH=\$PATH:~/trunk/src/config/bin' >> ~/.bashrc && source ~/.bashrc"
+  exit 1
 if [[ "$#" -lt 2 ]]; then
   echo "Usage: ${SCRIPT} base_name variant_name [bug_number]"
   echo "e.g. ${SCRIPT} puff wyvern b:158269582"