Author: jfrederic.clere(a)jboss.com
Date: 2007-12-11 09:06:50 -0500 (Tue, 11 Dec 2007)
New Revision: 1175
Added:
trunk/build/unix/util/find_gnu.sh
Log:
Find the gnu version of a tool. For patch for example.
Added: trunk/build/unix/util/find_gnu.sh
===================================================================
--- trunk/build/unix/util/find_gnu.sh (rev 0)
+++ trunk/build/unix/util/find_gnu.sh 2007-12-11 14:06:50 UTC (rev 1175)
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright(c) 2007 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Jean-Frederic Clere
+#
+
+# find a gnu command with path.
+# $1: The command.
+for path in `echo $PATH | sed "s/:/ /g"`
+do
+ file=$path/$1
+ $path/$1 --help 2>/dev/null | grep gnu 1>/dev/null
+ if [ $? -eq 0 ]; then
+ echo "$path/$1"
+ break
+ fi
+done
Property changes on: trunk/build/unix/util/find_gnu.sh
___________________________________________________________________
Name: svn:executable
+ *
Show replies by date