diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-06-11 12:17:16 +0200 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-07-12 00:14:35 +0200 |
commit | 45961a0c0cb77f1a53815aaea87b81d0f520f5bb (patch) | |
tree | 9401cd455d0ab9f88e9cdda5120a4da11901bf6d | |
parent | 31d76dabc7b90c9bfc1548aa7c83e31f7b3563e7 (diff) |
sh cmd substitution w/ backticks until git found
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 $().
-rw-r--r-- | git_version.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/git_version.sh b/git_version.sh index 5cf2943..0599d25 100644 --- a/git_version.sh +++ b/git_version.sh @@ -3,7 +3,7 @@ # Generate some basic versioning information which can be piped to a header. # # Copyright (c) 2006-2007 Luc Verhaegen <libv@skynet.be> -# Copyright (C) 2007 Hans Ulrich Niedermann <hun@n-dimensional.de> +# Copyright (C) 2007-2008 Hans Ulrich Niedermann <hun@n-dimensional.de> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -62,10 +62,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" @@ -73,7 +73,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" ] @@ -127,7 +127,7 @@ do shift done -# If not printing to stdout, redirect stdout to output file +# If not printing to stdout, redirect stdout to output file? rename_new_output=false if [ "x$outfile" = "x-" ] then @@ -137,7 +137,7 @@ else fi # Done with creating output files, so we can change to source dir -abs_srcdir="$(cd "$srcdir" && pwd)" +abs_srcdir=`cd "$srcdir" && pwd` cd "$srcdir" # Write program header @@ -164,6 +164,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 ||: |