summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
authorroot2013-08-01 17:28:22 +0200
committerroot2013-08-01 17:28:22 +0200
commitabcbf4fc4b9a979836688a4a346d00891f9ed452 (patch)
tree416702d6e7f7fbbef4b87d74720d936aa80774a2 /helper
parent[alsa.build] Inserted some %$ยง%-grep -v's for Scientific Linux. (diff)
downloadtm-scripts-abcbf4fc4b9a979836688a4a346d00891f9ed452.tar.gz
tm-scripts-abcbf4fc4b9a979836688a4a346d00891f9ed452.tar.xz
tm-scripts-abcbf4fc4b9a979836688a4a346d00891f9ed452.zip
[fileutil.inc] Added yum to packet managers
Diffstat (limited to 'helper')
-rw-r--r--helper/fileutil.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc
index 8d61344b..c93e82b8 100644
--- a/helper/fileutil.inc
+++ b/helper/fileutil.inc
@@ -39,7 +39,7 @@ list_packet_files() {
local FILES=""
if [ "$PACKET_MANAGER" = "apt" ]; then
FILES="$(dpkg -L "$PACKAGE" | grep -v -E 'share/(man|doc)|/var/run|/var/log'; echo ":###:${PIPESTATUS[0]}")"
- elif [ "$PACKET_MANAGER" = "zypper" ]; then
+ elif [ "$PACKET_MANAGER" = "zypper" -o "$PACKET_MANAGER" = "yum" ]; 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
@@ -83,6 +83,8 @@ install_packages() {
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
+ rpm -ql ${PKG} > /dev/null 2>&1
else
perror "No packet manager determined, this should not happen!"
fi
@@ -116,13 +118,23 @@ install_packages() {
# TODO error handling
pwarning "install_packages: zypper failed with '$?' for package '$PKG'"
fi
+ elif [ "x$PACKET_MANAGER" == "xyum" ]; then
+ yum --assumeyes install ${PKG}
+ local IRET=$?
+ if [ "x$IRET" == "x0" ]; then
+ # $PGK was installed successfully
+ INSTALLED_PACKAGES+="$PKG "
+ elif [ "x$IRET" == "x1" ]; then
+ # PKG was not installed
+ # TODO error handling
+ pwarning "install_packages: yum failed with '$?' for package '$PKG'"
+ fi
else
perror "No packet manager determined, this should not happen!"
fi
fi
done
[ ! -z "$INSTALLED_PACKAGES" ] && pinfo "Packages installed: ${INSTALLED_PACKAGES}"
-
}
#