Fix dependency list generation corner cases

* Handle empty install lists in apt_get() and pip_install()
* pip_install now uses get_packages() to get the dependency list

Fixes bug 948714

Change-Id: I174a60976df18c670eab2067edcd1871c51d07d6
diff --git a/functions b/functions
index adcf5bd..c4d56a2 100644
--- a/functions
+++ b/functions
@@ -4,7 +4,7 @@
 # apt-get wrapper to set arguments correctly
 # apt_get package [package ...]
 function apt_get() {
-    [[ "$OFFLINE" = "True" ]] && return
+    [[ "$OFFLINE" = "True" || -z "$@" ]] && return
     local sudo="sudo"
     [[ "$(id -u)" = "0" ]] && sudo="env"
     $sudo DEBIAN_FRONTEND=noninteractive \
@@ -124,7 +124,7 @@
 # pip install wrapper to set cache and proxy environment variables
 # pip_install package [package ...]
 function pip_install {
-    [[ "$OFFLINE" = "True" ]] && return
+    [[ "$OFFLINE" = "True" || -z "$@" ]] && return
     sudo PIP_DOWNLOAD_CACHE=/var/cache/pip \
         HTTP_PROXY=$http_proxy \
         HTTPS_PROXY=$https_proxy \