summaryrefslogtreecommitdiffstats
path: root/helper/fileutil.inc
diff options
context:
space:
mode:
authorChristian Rößler2013-08-21 16:26:32 +0200
committerChristian Rößler2013-08-21 16:26:32 +0200
commit05ef26e3caa4f3526f8e755cc7329def109c8d07 (patch)
tree32fc58d0b3f02cde843976cc7b3782587acf777c /helper/fileutil.inc
parent[system.inc] Added case / var PACKET_HANDLER (dpkg, rpm) for packet (diff)
downloadtm-scripts-05ef26e3caa4f3526f8e755cc7329def109c8d07.tar.gz
tm-scripts-05ef26e3caa4f3526f8e755cc7329def109c8d07.tar.xz
tm-scripts-05ef26e3caa4f3526f8e755cc7329def109c8d07.zip
[fileutil.inc] Introduced variable PACKET_HANDLER for simplification.
Diffstat (limited to 'helper/fileutil.inc')
-rw-r--r--helper/fileutil.inc14
1 files changed, 6 insertions, 8 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc
index c93e82b8..c0b9d69a 100644
--- a/helper/fileutil.inc
+++ b/helper/fileutil.inc
@@ -37,9 +37,9 @@ list_packet_files() {
local OPTIONAL="$(echo "$PACKAGE" | cut -c 1)"
[ "x$OPTIONAL" = "x@" ] && PACKAGE="$(echo "$PACKAGE" | cut -c 2-)"
local FILES=""
- if [ "$PACKET_MANAGER" = "apt" ]; then
+ if [ "$PACKET_HANDLER" = "dpkg" ]; then
FILES="$(dpkg -L "$PACKAGE" | grep -v -E 'share/(man|doc)|/var/run|/var/log'; echo ":###:${PIPESTATUS[0]}")"
- elif [ "$PACKET_MANAGER" = "zypper" -o "$PACKET_MANAGER" = "yum" ]; then
+ elif [ "$PACKET_HANDLER" = "rpm" ]; then
FILES="$(rpm -ql "$PACKAGE" | grep -v -E 'share/(doc|man)|/var/run|/var/log'; echo ":###:${PIPESTATUS[0]}")"
fi
# ugly hack to get our return value
@@ -70,7 +70,7 @@ install_dependencies() {
}
#
# install given packet through system's packet manager
-# uses PACKET_MANAGER as determined in helper/system.inc
+# uses PACKET_HANDLER as determined in helper/system.inc
#
install_packages() {
[ $# -eq 0 ] && perror "Sanity check failed: no argument given to install_package"
@@ -79,14 +79,12 @@ install_packages() {
for PKG in ${PACKAGE_LIST}; do
# check if installed
- if [ "x$PACKET_MANAGER" == "xapt" ]; then
+ if [ "x$PACKET_HANDLER" == "xdpkg" ]; then
dpkg -L ${PKG} > /dev/null 2>&1
- elif [ "x$PACKET_MANAGER" == "xzypper" ]; then
- rpm -ql ${PKG} > /dev/null 2>&1
- elif [ "x$PACKET_MANAGER" == "xyum" ]; then
+ elif [ "x$PACKET_HANDLER" == "xrpm" ]; then
rpm -ql ${PKG} > /dev/null 2>&1
else
- perror "No packet manager determined, this should not happen!"
+ perror "No packet manager / handler determined, this should not happen!"
fi
local LRET=$?