Create tools/install_prereqs.sh

* Factor system package prereq installs out to tools/install_prereqs.sh
* Set minimum time between runs with PREREQ_RERUN_HOURS
  default = 2 hours
* Create export_proxy_variables
* Force an update with install_prereqs.sh -f or by setting
  FORCE_PREREQ=true

Fixed an issue with exit/return in tools/install_prereqs.sh

Change-Id: I9a62090ad2f900b9b150cacb9cb02b326cb46972
diff --git a/functions b/functions
index 68aec5d..3f26b7f 100644
--- a/functions
+++ b/functions
@@ -80,6 +80,27 @@
 }
 
 
+# HTTP and HTTPS proxy servers are supported via the usual environment variables [1]
+# ``http_proxy``, ``https_proxy`` and ``no_proxy``. They can be set in
+# ``localrc`` or on the command line if necessary::
+#
+# [1] http://www.w3.org/Daemon/User/Proxies/ProxyClients.html
+#
+#     http_proxy=http://proxy.example.com:3128/ no_proxy=repo.example.net ./stack.sh
+
+function export_proxy_variables() {
+    if [[ -n "$http_proxy" ]]; then
+        export http_proxy=$http_proxy
+    fi
+    if [[ -n "$https_proxy" ]]; then
+        export https_proxy=$https_proxy
+    fi
+    if [[ -n "$no_proxy" ]]; then
+        export no_proxy=$no_proxy
+    fi
+}
+
+
 # Grab a numbered field from python prettytable output
 # Fields are numbered starting with 1
 # Reverse syntax is supported: -1 is the last field, -2 is second to last, etc.