Whamcloud - gitweb
LU-298 Improve check for dpkg system.
authorChristopher J. Morrone <morrone2@llnl.gov>
Tue, 10 May 2011 00:49:45 +0000 (17:49 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 May 2011 00:31:15 +0000 (17:31 -0700)
Use lsb_release id (Ubuntu, Debian, RedHatEnterpriseServer, etc.)
to determine if the system uses dpkg, instead of just checking for
the existence of the dpkg binary.  For example, some people do
install dpkg on their RHEL systems for various reasons.

Change-Id: I74db5277cb2db00927b74b652e7945bd95bca093
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/519
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Chris Gearing <chris@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
build/autoconf/lustre-build-linux.m4

index 188e805..0860b8b 100644 (file)
@@ -708,11 +708,14 @@ AS_VAR_POPDEF([ac_Header])dnl
 AC_DEFUN([LB_USES_DPKG],
 [
 AC_MSG_CHECKING([if this distro uses dpkg])
-if dpkg --version >/dev/null; then
-       AC_MSG_RESULT([yes])
-       uses_dpkg=yes
-else
-       AC_MSG_RESULT([no])
-       uses_dpkg=no
-fi
+case `lsb_release -i -s 2>/dev/null` in
+        Ubuntu | Debian)
+                AC_MSG_RESULT([yes])
+                uses_dpkg=yes
+                ;;
+        *)
+                AC_MSG_RESULT([no])
+                uses_dpkg=no
+                ;;
+esac
 ])