From 84ca02d7cac9efb1f449d8e8bc20f5cee6293f68 Mon Sep 17 00:00:00 2001
From: Matt Coddington <coddington@gmail.com>
Date: Fri, 27 Jan 2012 04:35:50 -0500
Subject: [PATCH] alphabetize os explorer

---
 conf/explorer/os | 65 +++++++++++++++++++++++++-----------------------
 1 file changed, 34 insertions(+), 31 deletions(-)

diff --git a/conf/explorer/os b/conf/explorer/os
index a7eebb8a..3f3ce266 100755
--- a/conf/explorer/os
+++ b/conf/explorer/os
@@ -18,13 +18,14 @@
 # along with cdist. If not, see <http://www.gnu.org/licenses/>.
 #
 #
-# All os variables are lower case
-#
+# All os variables are lower case.  Keep this file in alphabetical
+# order by os variable except in cases where order otherwise matters,
+# in which case keep the primary os and its derivatives together in
+# a block (see Debian and Redhat examples below).
 #
 
-# Ubuntu is also Debian, thus return if Ubuntu was found
-if grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null; then
-   echo ubuntu
+if grep -q ^Amazon /etc/system-release 2>/dev/null; then
+   echo amazon
    exit 0
 fi
 
@@ -33,50 +34,52 @@ if [ -f /etc/arch-release ]; then
    exit 0
 fi
 
+if [ -f /etc/cdist-preos ]; then
+   echo cdist-preos
+   exit 0
+fi
+
+### Debian and derivatives
+if grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null; then
+   echo ubuntu
+   exit 0
+fi
+
 if [ -f /etc/debian_version ]; then
    echo debian
    exit 0
 fi
+###
 
 if [ -f /etc/gentoo-release ]; then
    echo gentoo
    exit 0
 fi
 
-# Fedora is also Redhat, thus return before redhat!
-if grep -q ^Fedora /etc/redhat-release 2>/dev/null; then
-   echo fedora
-   exit 0
-fi
-
-# CentOS is also based on Redhat, thus return before redhat!
-if grep -q ^CentOS /etc/redhat-release 2>/dev/null; then
-    echo centos
-    exit 0
-fi
-
-if [ -f /etc/redhat-release ]; then
-   echo redhat
-   exit 0
-fi
-
-if [ -f /etc/SuSE-release ]; then
-   echo suse
-   exit 0
-fi
-
 if [ -f /etc/owl-release ]; then
    echo owl
    exit 0
 fi
 
-if [ -f /etc/cdist-preos ]; then
-   echo cdist-preos
+### Redhat and derivatives
+if grep -q ^CentOS /etc/redhat-release 2>/dev/null; then
+    echo centos
+    exit 0
+fi
+
+if grep -q ^Fedora /etc/redhat-release 2>/dev/null; then
+   echo fedora
    exit 0
 fi
 
-if grep -q ^Amazon /etc/system-release 2>/dev/null; then
-   echo amazon
+if [ -f /etc/redhat-release ]; then
+   echo redhat
+   exit 0
+fi
+###
+
+if [ -f /etc/SuSE-release ]; then
+   echo suse
    exit 0
 fi