1
0
mirror of synced 2026-01-29 12:51:02 +00:00

Factor out functions to test if we should use yum or apt

This commit is contained in:
Axel Beckert
2013-01-23 17:40:00 +01:00
parent bce580658e
commit 0c8b5d25c4

View File

@@ -224,6 +224,13 @@ installRPMPackage ()
installCentOS4Package () { installRPMPackage "$@" }
#
# Functions to test if we're on a redhatesk or debianesk system
#
isAPT() ( [ -x $1/usr/bin/apt-get ] )
isYum() ( [ -x $1/usr/bin/yum ] )
#
# Install a package using whatever package management tool is available
#
@@ -232,10 +239,10 @@ installPackage ()
prefix=$1
package=$2
if [ -x ${prefix}/usr/bin/apt-get ] ; then
if isAPT ; then
installDebianPackage "$@"
elif [ -x ${prefix}/usr/bin/yum ] ; then
elif isYum ; then
installRPMPackage "$@"
else