From 219159870e10577edb4ffff0f1a8c3931bb33a35 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 23 Sep 2015 15:24:49 -0600 Subject: Improve the determination of rpm or deb based distribution. Change-Id: I6bc8695ca92da4dfec77b697871c50104ead33b6 --- configure | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 248a2916..cb52d4e9 100755 --- a/configure +++ b/configure @@ -3739,13 +3739,17 @@ fi # AC_MSG_WARN([Make 4.0 is missing, which is required]) #fi +# Figure out which packaging system is in use. Since it's possible to +# install both on a system. +rpm="`uname -a | grep -ic '\.fc[0-9].\.'`" +deb="`uname -a | grep -ic 'ubuntu'`" +deb=$(($deb + `uname -a | grep -ic 'debian'`)) + #packages="git-svn bzr-fastimport svn-all-fast-exp libncurses5-dev texinfo" packages="texinfo gawk" ### Debian packages ### -dpkg="`which dpkg 2> /dev/null`" -result=$? -if test ${result} -eq 0; then +if test ${deb} -ge 1; then # add Ubuntu specific packages if test x"${BUILD_ARCH}" != xaarch64; then packages="${packages} gcc-multilib g++-multilib libncurses5-dev libpython2.7-dev" @@ -3767,9 +3771,7 @@ $as_echo "yes" >&6; } ### RPM Packages ### else -yum="`which yum 2> /dev/null`" -result=$? -if test ${result} -eq 0; then +if test ${rpm} -eq 1; then packages="${packages} ncurses-devel python-devel" for i in ${packages}; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $i is installed" >&5 @@ -3778,7 +3780,7 @@ $as_echo_n "checking if $i is installed... " >&6; } # can't be searched on meta-package name, so strip off any trailing # information when searching the rpm database. exists="`rpm -q -a ${i//.*/}| grep -c ${i//.*/}`" - if test ${exists} -eq 0; then + if test ${exists:-0} -eq 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, install $i" >&5 $as_echo "no, install $i" >&6; } missing="${missing} $i" -- cgit v1.2.3