diff options
author | zuul <zuul@gerrit.asterisk.org> | 2016-03-17 17:42:41 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-03-17 17:42:42 -0500 |
commit | 65ad76113033f7b18ae36a98e731c67fdade0d63 (patch) | |
tree | 9a6459f19b05a9e848a391deedee7aa70eea5bcf /contrib/scripts | |
parent | d444a2713f5da11d42079ee17ac5edeb3c9f5f16 (diff) | |
parent | efcf9a96db6c40ea658f597714d0ff841ec0d412 (diff) |
Merge "install_prereq: Check if is installed aptitude otherwise to install." into 13
Diffstat (limited to 'contrib/scripts')
-rwxr-xr-x | contrib/scripts/install_prereq | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq index 0e6fbcf81..afad1f719 100755 --- a/contrib/scripts/install_prereq +++ b/contrib/scripts/install_prereq @@ -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 update $testcmd aptitude install -y $extra_packs |