Skip to content
Snippets Groups Projects
Commit a6446332 authored by Matt Jordan's avatar Matt Jordan Committed by Gerrit Code Review
Browse files

Merge "install_prereq: Check if is installed aptitude otherwise to install."

parents 30cd5593 6737ded0
No related branches found
No related tags found
No related merge requests found
......@@ -70,9 +70,10 @@ check_installed_debs() {
do
tocheck="${tocheck} ^${pack}$"
done
aptitude -F '%c %p' search ${tocheck} 2>/dev/null \
| awk '/^p/{print $2}' \
| grep -v ':i386$'
pkgs=$(aptitude -F '%c %p' search ${tocheck} 2>/dev/null | awk '/^p/{print $2}')
if ! [ ${#pkgs} -eq 0 ]; then
echo $pkgs | grep -v ':i386$'
fi
}
# parsing the output of yum is close to impossible.
......@@ -96,6 +97,9 @@ check_installed_pkgs() {
}
handle_debian() {
if ! [ -x "$(command -v aptitude)" ]; then
apt-get install aptitude
fi
extra_packs=`check_installed_debs $PACKAGES_DEBIAN`
$testcmd aptitude install -y $extra_packs
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment