]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Fix distribution detection
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 5 Mar 2012 18:22:23 +0000 (10:22 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 5 Mar 2012 18:38:38 +0000 (10:38 -0800)
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>
config/spl-build.m4
configure

index eee950c6704e19621a355f921f1013b54ffe3c3e..6605b826d6be5da740a7d96d5287f86dd922b663 100644 (file)
@@ -371,22 +371,26 @@ dnl # package type for 'make pkg': (rpm | deb | tgz)
 dnl #
 AC_DEFUN([SPL_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/arch-release ; then
                VENDOR=arch ;
-       elif test -f /etc/lsb-release ; then
-               VENDOR=ubuntu ;
-       elif test -f /etc/debian_version ; then
-               VENDOR=debian ;
        elif test -f /etc/SuSE-release ; then
                VENDOR=sles ;
        elif test -f /etc/slackware-version ; then
                VENDOR=slackware ;
-       elif test -f /etc/gentoo-release ; then
-               VENDOR=gentoo ;
+       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
@@ -395,14 +399,17 @@ AC_DEFUN([SPL_AC_DEFAULT_PACKAGE], [
 
        AC_MSG_CHECKING([default package type])
        case "$VENDOR" in
-               fedora)     DEFAULT_PACKAGE=rpm ;;
-               redhat)     DEFAULT_PACKAGE=rpm ;;
-               sles)       DEFAULT_PACKAGE=rpm ;;
-               ubuntu)     DEFAULT_PACKAGE=deb ;;
-               debian)     DEFAULT_PACKAGE=deb ;;
-               slackware)  DEFAULT_PACKAGE=tgz ;;
-               arch)       DEFAULT_PACKAGE=arch;;
-               *)          DEFAULT_PACKAGE=rpm ;;
+               toss)       DEFAULT_PACKAGE=rpm  ;;
+               redhat)     DEFAULT_PACKAGE=rpm  ;;
+               fedora)     DEFAULT_PACKAGE=rpm  ;;
+               gentoo)     DEFAULT_PACKAGE=tgz  ;;
+               arch)       DEFAULT_PACKAGE=arch ;;
+               sles)       DEFAULT_PACKAGE=rpm  ;;
+               slackware)  DEFAULT_PACKAGE=tgz  ;;
+               lunar)      DEFAULT_PACKAGE=tgz  ;;
+               ubuntu)     DEFAULT_PACKAGE=deb  ;;
+               debian)     DEFAULT_PACKAGE=deb  ;;
+               *)          DEFAULT_PACKAGE=rpm  ;;
        esac
 
        AC_MSG_RESULT([$DEFAULT_PACKAGE])
index 3d67ecef2a768851f704b97131911bc3d86f97fa..f4a9f139fd2e576c3351c831697982481f6386bb 100755 (executable)
--- a/configure
+++ b/configure
@@ -11493,22 +11493,26 @@ $as_echo "$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/arch-release ; then
                VENDOR=arch ;
-       elif test -f /etc/lsb-release ; then
-               VENDOR=ubuntu ;
-       elif test -f /etc/debian_version ; then
-               VENDOR=debian ;
        elif test -f /etc/SuSE-release ; then
                VENDOR=sles ;
        elif test -f /etc/slackware-version ; then
                VENDOR=slackware ;
-       elif test -f /etc/gentoo-release ; then
-               VENDOR=gentoo ;
+       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
@@ -11519,14 +11523,17 @@ $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
-               fedora)     DEFAULT_PACKAGE=rpm ;;
-               redhat)     DEFAULT_PACKAGE=rpm ;;
-               sles)       DEFAULT_PACKAGE=rpm ;;
-               ubuntu)     DEFAULT_PACKAGE=deb ;;
-               debian)     DEFAULT_PACKAGE=deb ;;
-               slackware)  DEFAULT_PACKAGE=tgz ;;
-               arch)       DEFAULT_PACKAGE=arch;;
-               *)          DEFAULT_PACKAGE=rpm ;;
+               toss)       DEFAULT_PACKAGE=rpm  ;;
+               redhat)     DEFAULT_PACKAGE=rpm  ;;
+               fedora)     DEFAULT_PACKAGE=rpm  ;;
+               gentoo)     DEFAULT_PACKAGE=tgz  ;;
+               arch)       DEFAULT_PACKAGE=arch ;;
+               sles)       DEFAULT_PACKAGE=rpm  ;;
+               slackware)  DEFAULT_PACKAGE=tgz  ;;
+               lunar)      DEFAULT_PACKAGE=tgz  ;;
+               ubuntu)     DEFAULT_PACKAGE=deb  ;;
+               debian)     DEFAULT_PACKAGE=deb  ;;
+               *)          DEFAULT_PACKAGE=rpm  ;;
        esac
 
        { $as_echo "$as_me:$LINENO: result: $DEFAULT_PACKAGE" >&5