From 05ef26e3caa4f3526f8e755cc7329def109c8d07 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Wed, 21 Aug 2013 16:26:32 +0200 Subject: [fileutil.inc] Introduced variable PACKET_HANDLER for simplification. --- helper/fileutil.inc | 14 ++++++-------- 1 file 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=$? -- cgit v1.2.3-55-g7522