git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Bryan Larsen <bryanlarsen@yahoo.com>
Date
Jul 16, 2005, 23:23 UTC
Message-ID
<20050716232341.7317.4962.sendpatchset@bryan-larsens-ibook-g4.local>
In-Reply-To
<20050716232308.7317.56890.sendpatchset@bryan-larsens-ibook-g4.local>
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 |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cg-Xlib b/cg-Xlib
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -229,11 +229,11 @@ 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=$(which gnustat 2> /dev/null ||
+    which gstat 2> /dev/null ||
+    which stat 2>/dev/null)
 [ "$has_stat" ] && $has_stat -c %s / 2>/dev/null >&2 || has_stat=
 has_gnudate=$(date -Rud "1970-01-01 UTC" 2>/dev/null)
Previous: Bryan LarsenNext: Bryan Larsen
Message 4 of 6 in “cogito: compatibility with OS X”
  1. 0/5 cogito: compatibility with OS XBryan Larsen, Jul 16, 2005
  2. 1/5 cogito: remove use of xargs -r, a non-portable GNU extensionBryan Larsen, Jul 16, 2005
  3. 2/5 cogito: remove use of cp -a, a non-portable GNU extensionBryan Larsen, Jul 16, 2005
  4. 3/5 cogito: try harder to find gnu statBryan Larsen, Jul 16, 2005
  5. 4/5 cogito: try harder to find gnu dateBryan Larsen, Jul 16, 2005
  6. 5/5 cogito: remove findutils dependency from PortfileBryan Larsen, Jul 16, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.