Mailinglist Archive: radeonhd (529 mails)

< Previous Next >
[radeonhd] [PATCH] sh cmd substitution w/ backticks until git found
  • From: Hans Ulrich Niedermann <hun@xxxxxxxxxxxxxxxx>
  • Date: Wed, 5 Dec 2007 10:03:27 +0100
  • Message-id: <1196845407-2996-1-git-send-email-hun@xxxxxxxxxxxxxxxx>
git's sh scripts use $(), so if we have detected git we know there is
a $() capable sh on board somewhere and can use it. Until then, we use
`` and hope our quoting is a) correct and b) works even on those
ancient sh implementations which may have problems with $().
---
git_version.sh | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/git_version.sh b/git_version.sh
index 52b130e..10acee0 100644
--- a/git_version.sh
+++ b/git_version.sh
@@ -29,10 +29,10 @@ Options:
SED="${SED-sed}"

# Initialize
-working_dir="$(pwd)"
+working_dir=`pwd`

# Who am I?
-self="$(basename "$0")"
+self=`basename "$0"`

# Defaults
ifndef_symbol="GIT_VERSION_H"
@@ -40,7 +40,7 @@ outfile="-"
print_example=false
keep_if_no_repo=no
quiet=false
-srcdir="$(pwd)"
+srcdir=`pwd`

# Parse command line parameter, affecting defaults
while [ "x$1" != "x" ]
@@ -131,6 +131,7 @@ do
break
fi
done
+# If git_found=yes, we can now use $() substitutions (as git does). Hooray!

# Determine git specific defines
unset git_errors ||:
--
1.5.3.4

--
To unsubscribe, e-mail: radeonhd+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: radeonhd+help@xxxxxxxxxxxx

< Previous Next >
References