summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--helper/fileutil.inc14
1 files changed, 13 insertions, 1 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc
index f4cfe298..d37d546e 100644
--- a/helper/fileutil.inc
+++ b/helper/fileutil.inc
@@ -9,7 +9,19 @@ else
perror "Could not determine this platform's packet manager"
fi
-#
+# install given packet through system's packet manager
+install_package() {
+ [ $# -eq 0 ] && perror "Sanity check failed: no argument given to install_package"
+ local PACKAGE_LIST="$@"
+ for PACKAGE in $PACKAGE_LIST; do
+ if [ "x$PACKET_MANAGER" == "xapt" ]; then
+ apt-get install -y $PACKAGE
+ elif [ "x$PACKET_MANAGER" == "xzypper" ]; then
+ zypper --no-refresh install -y $PACKAGE
+ fi
+ # TODO finish...
+ done
+}
# copy list of files using tar
tarcopy () {