From d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 4 Jul 2014 14:46:20 +0200 Subject: "Fedora Support", step 1 -> Several changes: 1) Make sure /bin /sbin /lib and /lib64 are ALWAYS symlinks to /usr/XXX, no matter what the current distribution does. 2) Make sure nobody and nogroup exist. 3) Fix various modules making assumptions that are not true on every distro. 4) Add symlinks to kdm module since fedora is looking for kdmrc in yet another spot. 5) Add detection of fedora, support its package manager What still breaks: dnbd3 Other distros might not work now, they need adaption to changed logic in some modules. --- remote/includes/packagemanager.inc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'remote/includes/packagemanager.inc') diff --git a/remote/includes/packagemanager.inc b/remote/includes/packagemanager.inc index 66013807..63acf270 100644 --- a/remote/includes/packagemanager.inc +++ b/remote/includes/packagemanager.inc @@ -98,34 +98,36 @@ install_packages() { [ $# -eq 0 ] && perror "Sanity check failed: no argument given to install_package" local PACKAGE_LIST="$@" local INSTALLED_PACKAGES="" + local LRET="" for PKG in ${PACKAGE_LIST}; do # check if installed: # this is done mainly for performance reasons, even though - # reinstalling all packages is a valid possibility too... + # reinstalling all packages is a valid possibility too... if [ "x$PACKET_HANDLER" == "xdpkg" ]; then dpkg -l ${PKG} > /dev/null 2>&1 + LRET=$? elif [ "x$PACKET_HANDLER" == "xrpm" ]; then - rpm -ql ${PKG} > /dev/null 2>&1 + rpm -ql "${PKG}" > /dev/null 2>&1 + LRET=$? else perror "No packet manager / handler determined, this should not happen!" fi - local LRET=$? if [ "x$LRET" == "x0" ]; then # check if it is completly installed, not just leftover configuration files if [ "x$PACKET_HANDLER" == "xdpkg" ]; then - local INSTALL_STATUS=$(dpkg -l $PKG | grep $PKG | cut -c1-2) + local INSTALL_STATUS=$(dpkg -l "${PKG}" | grep "${PKG}" | cut -c1-2) if [[ $INSTALL_STATUS != "ii" ]]; then pinfo "$PKG is either missing or a meta-package! Installing it to be sure..." - install_package $PKG + install_package "${PKG}" else # package installed - pdebug "$PKG installed!" + pdebug "${PKG} installed!" fi elif [ "x$PACKET_HANDLER" == "xrpm" ]; then # TODO: blindly install again for now - install_package $PKG + rpm -q "${PKG}" >/dev/null 2>&1 || install_package "${PKG}" fi else # package not installed -- cgit v1.2.3-55-g7522