summaryrefslogtreecommitdiffstats
path: root/remote/includes/packagemanager.inc
diff options
context:
space:
mode:
authorSimon Rettberg2014-07-04 14:46:20 +0200
committerSimon Rettberg2014-07-04 14:46:20 +0200
commitd1f5aedd76df437a08f3283fa00bc8a9dab7fa2b (patch)
tree8c046eeaf8e874b479b95964b2bf410365cff438 /remote/includes/packagemanager.inc
parentremove hardcoded /bin/rm call. Relative calls work in services files (diff)
downloadtm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.tar.gz
tm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.tar.xz
tm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.zip
"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.
Diffstat (limited to 'remote/includes/packagemanager.inc')
-rw-r--r--remote/includes/packagemanager.inc16
1 files changed, 9 insertions, 7 deletions
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