Fix distribution detection

Improve the distribution detection by moving the tests for
distribution specific files first.  The Ubuntu and Debian
checks are left for last because they are the least likely
to be unique.  This is particularly true in the case of Debian
since so many distributions are based on Debian.

Since this is currently only used to identify the correct
packaging method for this system the result in many instances
is simply cosmetic.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Richard Yao 2012-02-28 16:23:16 -05:00 committed by Brian Behlendorf
parent 613d88eda8
commit 76c2b24c61
2 changed files with 58 additions and 50 deletions

View File

@ -226,24 +226,26 @@ dnl # package type for 'make pkg': (rpm | deb | tgz)
dnl #
AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
AC_MSG_CHECKING([linux distribution])
if test -f /etc/redhat-release ; then
VENDOR=redhat ;
if test -f /etc/toss-release ; then
VENDOR=toss ;
elif test -f /etc/fedora-release ; then
VENDOR=fedora ;
elif test -f /etc/redhat-release ; then
VENDOR=redhat ;
elif test -f /etc/gentoo-release ; then
VENDOR=gentoo ;
elif test -f /etc/debian_version ; then
VENDOR=debian ;
elif test -f /etc/arch-release ; then
VENDOR=arch ;
elif test -f /etc/SuSE-release ; then
VENDOR=sles ;
elif test -f /etc/slackware-version ; then
VENDOR=slackware ;
elif test -f /etc/arch-release ; then
VENDOR=arch ;
elif test -f /etc/lsb-release ; then
VENDOR=ubuntu ;
elif test -f /etc/lunar.release ; then
VENDOR=lunar ;
elif test -f /etc/lsb-release ; then
VENDOR=ubuntu ;
elif test -f /etc/debian_version ; then
VENDOR=debian ;
else
VENDOR= ;
fi
@ -252,15 +254,16 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
AC_MSG_CHECKING([default package type])
case "$VENDOR" in
toss) DEFAULT_PACKAGE=rpm ;;
redhat) DEFAULT_PACKAGE=rpm ;;
fedora) DEFAULT_PACKAGE=rpm ;;
ubuntu) DEFAULT_PACKAGE=deb ;;
debian) DEFAULT_PACKAGE=deb ;;
gentoo) DEFAULT_PACKAGE=tgz ;;
arch) DEFAULT_PACKAGE=arch ;;
sles) DEFAULT_PACKAGE=rpm ;;
slackware) DEFAULT_PACKAGE=tgz ;;
gentoo) DEFAULT_PACKAGE=tgz ;;
lunar) DEFAULT_PACKAGE=tgz ;;
arch) DEFAULT_PACKAGE=arch;;
ubuntu) DEFAULT_PACKAGE=deb ;;
debian) DEFAULT_PACKAGE=deb ;;
*) DEFAULT_PACKAGE=rpm ;;
esac
@ -278,15 +281,16 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
AC_MSG_CHECKING([default init script type])
case "$VENDOR" in
toss) DEFAULT_INIT_SCRIPT=redhat ;;
redhat) DEFAULT_INIT_SCRIPT=redhat ;;
fedora) DEFAULT_INIT_SCRIPT=fedora ;;
ubuntu) DEFAULT_INIT_SCRIPT=lsb ;;
debian) DEFAULT_INIT_SCRIPT=lsb ;;
gentoo) DEFAULT_INIT_SCRIPT=gentoo ;;
arch) DEFAULT_INIT_SCRIPT=arch ;;
sles) DEFAULT_INIT_SCRIPT=lsb ;;
slackware) DEFAULT_INIT_SCRIPT=lsb ;;
gentoo) DEFAULT_INIT_SCRIPT=gentoo ;;
lunar) DEFAULT_INIT_SCRIPT=lunar ;;
arch) DEFAULT_INIT_SCRIPT=arch ;;
ubuntu) DEFAULT_INIT_SCRIPT=lsb ;;
debian) DEFAULT_INIT_SCRIPT=lsb ;;
*) DEFAULT_INIT_SCRIPT=lsb ;;
esac

36
configure vendored
View File

@ -11674,24 +11674,26 @@ $as_echo "$ZFS_META_LICENSE" >&6; }
{ $as_echo "$as_me:$LINENO: checking linux distribution" >&5
$as_echo_n "checking linux distribution... " >&6; }
if test -f /etc/redhat-release ; then
VENDOR=redhat ;
if test -f /etc/toss-release ; then
VENDOR=toss ;
elif test -f /etc/fedora-release ; then
VENDOR=fedora ;
elif test -f /etc/redhat-release ; then
VENDOR=redhat ;
elif test -f /etc/gentoo-release ; then
VENDOR=gentoo ;
elif test -f /etc/debian_version ; then
VENDOR=debian ;
elif test -f /etc/arch-release ; then
VENDOR=arch ;
elif test -f /etc/SuSE-release ; then
VENDOR=sles ;
elif test -f /etc/slackware-version ; then
VENDOR=slackware ;
elif test -f /etc/arch-release ; then
VENDOR=arch ;
elif test -f /etc/lsb-release ; then
VENDOR=ubuntu ;
elif test -f /etc/lunar.release ; then
VENDOR=lunar ;
elif test -f /etc/lsb-release ; then
VENDOR=ubuntu ;
elif test -f /etc/debian_version ; then
VENDOR=debian ;
else
VENDOR= ;
fi
@ -11702,15 +11704,16 @@ $as_echo "$VENDOR" >&6; }
{ $as_echo "$as_me:$LINENO: checking default package type" >&5
$as_echo_n "checking default package type... " >&6; }
case "$VENDOR" in
toss) DEFAULT_PACKAGE=rpm ;;
redhat) DEFAULT_PACKAGE=rpm ;;
fedora) DEFAULT_PACKAGE=rpm ;;
ubuntu) DEFAULT_PACKAGE=deb ;;
debian) DEFAULT_PACKAGE=deb ;;
gentoo) DEFAULT_PACKAGE=tgz ;;
arch) DEFAULT_PACKAGE=arch ;;
sles) DEFAULT_PACKAGE=rpm ;;
slackware) DEFAULT_PACKAGE=tgz ;;
gentoo) DEFAULT_PACKAGE=tgz ;;
lunar) DEFAULT_PACKAGE=tgz ;;
arch) DEFAULT_PACKAGE=arch;;
ubuntu) DEFAULT_PACKAGE=deb ;;
debian) DEFAULT_PACKAGE=deb ;;
*) DEFAULT_PACKAGE=rpm ;;
esac
@ -11732,15 +11735,16 @@ $as_echo "$DEFAULT_INIT_DIR" >&6; }
{ $as_echo "$as_me:$LINENO: checking default init script type" >&5
$as_echo_n "checking default init script type... " >&6; }
case "$VENDOR" in
toss) DEFAULT_INIT_SCRIPT=redhat ;;
redhat) DEFAULT_INIT_SCRIPT=redhat ;;
fedora) DEFAULT_INIT_SCRIPT=fedora ;;
ubuntu) DEFAULT_INIT_SCRIPT=lsb ;;
debian) DEFAULT_INIT_SCRIPT=lsb ;;
gentoo) DEFAULT_INIT_SCRIPT=gentoo ;;
arch) DEFAULT_INIT_SCRIPT=arch ;;
sles) DEFAULT_INIT_SCRIPT=lsb ;;
slackware) DEFAULT_INIT_SCRIPT=lsb ;;
gentoo) DEFAULT_INIT_SCRIPT=gentoo ;;
lunar) DEFAULT_INIT_SCRIPT=lunar ;;
arch) DEFAULT_INIT_SCRIPT=arch ;;
ubuntu) DEFAULT_INIT_SCRIPT=lsb ;;
debian) DEFAULT_INIT_SCRIPT=lsb ;;
*) DEFAULT_INIT_SCRIPT=lsb ;;
esac