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 re_export_proxy_variables

Change-Id: I4a182b1da685f403d6abdd8540d2114796c01682
diff --git a/functions b/functions
index 3ee43d3..7de5a44 100644
--- a/functions
+++ b/functions
@@ -710,6 +710,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 re_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
+}
+
+
 # Helper to launch a service in a named screen
 # screen_it service "command-line"
 function screen_it {