Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbtek committed Nov 2, 2016
1 parent 605ec93 commit af7091b
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions libraries/util.bash
Original file line number Diff line number Diff line change
Expand Up @@ -436,29 +436,11 @@ function installBuildEssential()
fi
}

function installPackages()
function installBZip2Command()
{
local -r packages=("${@}")

if [[ "$(isUbuntuDistributor)" = 'true' ]]
then
runAptGetUpdate ''
fi

local package=''
local -r commandPackage=('bzip2' 'bzip2')

for package in "${packages[@]}"
do
if [[ "$(isUbuntuDistributor)" = 'true' ]]
then
installAptGetPackage "${package}"
elif [[ "$(isCentOSDistributor)" = 'true' || "$(isRedHatDistributor)" = 'true' ]]
then
yum install -y "${package}"
else
fatal '\nFATAL : only support CentOS, RedHat or Ubuntu OS'
fi
done
installCommands "${commandPackage[@]}"
}

function installCleanUp()
Expand Down Expand Up @@ -518,6 +500,31 @@ function installPackage()
fi
}

function installPackages()
{
local -r packages=("${@}")

if [[ "$(isUbuntuDistributor)" = 'true' ]]
then
runAptGetUpdate ''
fi

local package=''

for package in "${packages[@]}"
do
if [[ "$(isUbuntuDistributor)" = 'true' ]]
then
installAptGetPackage "${package}"
elif [[ "$(isCentOSDistributor)" = 'true' || "$(isRedHatDistributor)" = 'true' ]]
then
yum install -y "${package}"
else
fatal '\nFATAL : only support CentOS, RedHat or Ubuntu OS'
fi
done
}

function installPIPCommand()
{
local -r commandPackage=('pip' 'python-pip')
Expand Down

0 comments on commit af7091b

Please sign in to comment.