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

[PATCH 2/6] config-sh: find and verify utils

From
Bryan Larsen <bryanlarsen@yahoo.com>
Date
Jul 11, 2005, 10:14 UTC
Message-ID
<20050711101443.10318.71126.sendpatchset@bryan-larsens-ibook-g4.local>
In-Reply-To
<20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local>
Add config.sh which searches for gnu versions of 'cp' 'stat' 'date' and 'xargs'.
Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---
 config.sh |   65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)
diff --git a/config.sh b/config.sh
new file mode 100755
--- /dev/null
+++ b/config.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# Search for gnu utils.
+# Copyright (c) Bryan Larsen, 2005
+#
+# cogito and git-*-script rely on gnu versions of
+# cp, date, xargs and stat.  Look for them and
+# ensure they're gnu.
+#
+
+set -e
+
+if which gdate > /dev/null ; then 
+    DATE=gdate ;
+else 
+    DATE=date ; 
+fi ;
+
+# you don't actually have to have gnu date, it just works better.
+
+if which gcp > /dev/null ; then 
+    CP=gcp ; 
+else 
+    CP=cp ; 
+fi ;
+
+if $CP -a config.sh cp-test-dummy ; then 
+    rm cp-test-dummy ;
+else 
+    echo 'You must have gnu cp installed'; 
+    exit 1; 
+fi ;
+
+if which gnuxargs > /dev/null ; then 
+    XARGS=gnuxargs ; 
+else 
+    XARGS=xargs ; 
+fi ;
+
+if ! ( echo | $XARGS -r ) ; then 
+    echo 'You must have gnu xargs installed'; 
+    exit 1; 
+fi ;
+
+if which gstat > /dev/null ; then
+    STAT=gstat ;
+else
+    STAT=stat ;
+fi ;
+
+if ! ($STAT -c '%s' config.sh > /dev/null ) ; then
+    if which awk > /dev/null ; then
+	STAT=dont_have_stat ;
+    else
+	echo 'You must have awk or gnu stat installed.';
+	exit 1;
+    fi
+fi ;
+
+echo CP=$CP > config
+echo XARGS=$XARGS >> config
+echo DATE=$DATE >> config
+echo STAT=$STAT >> config
+
+set +e
Previous: Bryan LarsenNext: Bryan Larsen
Message 3 of 18 in “parameterize gnu tool names; add Portfile for OS X darwinports”
  1. 0/6 parameterize gnu tool names; add Portfile for OS X darwinportsBryan Larsen, Jul 11, 2005
  2. 1/6 git-gnu-progs: parameterize gitBryan Larsen, Jul 11, 2005
  3. 2/6 config-sh: find and verify utilsBryan Larsen, Jul 11, 2005
  4. 3/6 git-gnu-progs-Makefile: git Makefile updateBryan Larsen, Jul 11, 2005
  5. Junio C HamanoJul 11, 2005
  6. Linus TorvaldsJul 11, 2005
  7. Bryan LarsenJul 11, 2005
  8. Linus TorvaldsJul 11, 2005
  9. Matthias UrlichsJul 12, 2005
  10. Junio C HamanoJul 11, 2005
  11. Bryan LarsenJul 11, 2005
  12. Junio C HamanoJul 11, 2005
  13. Bryan LarsenJul 11, 2005
  14. Junio C HamanoJul 11, 2005
  15. Bryan LarsenJul 11, 2005
  16. 4/6 cogito-gnu-progs: parameterize cogitoBryan Larsen, Jul 11, 2005
  17. 5/6 cogito-gnu-progs-Makefile: cogito Makefile updateBryan Larsen, Jul 11, 2005
  18. 6/6 darwinports-Portfile: Portfile for cogitoBryan Larsen, Jul 11, 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.