[PATCH 3/6] cogito: try harder to find gnu stat

From: Bryan Larsen <bryanlarsen@yahoo.com>
Date: 2005-07-18 12:51:02
Look harder for gnu stat.

Cogito has code to use awk if gnu stat is missing.  Look harder 
for gnu stat under alternate names such as gstat and gnustat, avoiding
the use of awk if possible.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 cg-Xlib |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/cg-Xlib b/cg-Xlib
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -229,11 +229,16 @@ fi
 
 
 # Compatibility hacks:
-# Fortunately none as of now.
-
 
 export BROKEN_MKTEMP=1
 del=$($(which mktemp) -t 2>/dev/null) && { rm $del; export BROKEN_MKTEMP=; }
-has_stat=$(which stat 2>/dev/null)
-[ "$has_stat" ] && $has_stat -c %s / 2>/dev/null >&2 || has_stat=
+
+has_stat=
+for stat in "$(which gnustat)" "$(which gstat)" "$(which stat)" ; do
+    if ( [ $stat ] && $stat -c %s / 2> /dev/null >&2 ) ; then
+	has_stat=$stat
+	break
+    fi
+done
+
 has_gnudate=$(date -Rud "1970-01-01 UTC" 2>/dev/null)
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Jul 18 12:51:15 2005

This archive was generated by hypermail 2.1.8 : 2005-07-18 12:51:17 EST