aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/build-aux/git-package-version.sh
diff options
context:
space:
mode:
authorDavid M. Syzdek <syzdek@bindlebinaries.com>2012-12-13 11:31:41 -0900
committerDavid M. Syzdek <syzdek@bindlebinaries.com>2012-12-13 11:31:41 -0900
commit61ea1e49fd974e96daab82d74470a1fcd163c77c (patch)
tree863dcd08b9d023507df82b1ba9dfcea1ba55fc5b /build-aux/git-package-version.sh
parent2e1e35ffd49592e77cb1f4fe56fcd0f13784e1ab (diff)
downloadbindletools-61ea1e49fd974e96daab82d74470a1fcd163c77c.tar.gz
bindletools-61ea1e49fd974e96daab82d74470a1fcd163c77c.tar.bz2
bindletools-61ea1e49fd974e96daab82d74470a1fcd163c77c.tar.xz
bindletools-61ea1e49fd974e96daab82d74470a1fcd163c77c.zip
Renaming variables to clarify purpose.
Diffstat (limited to 'build-aux/git-package-version.sh')
-rwxr-xr-xbuild-aux/git-package-version.sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/build-aux/git-package-version.sh b/build-aux/git-package-version.sh
index aec136b..723bba0 100755
--- a/build-aux/git-package-version.sh
+++ b/build-aux/git-package-version.sh
@@ -37,17 +37,18 @@
37 37
38 38
39# saves srcdir from command line arguments 39# saves srcdir from command line arguments
40if test "x${1}" == "x";then 40if test "x${0}" == "x";then
41 echo "Usage: ${0} srcdir [ savedir ]" 1>&2; 41 echo "Usage: ${0} srcdir [ outdir ]" 1>&2;
42 echo "Usage: ${0} auto" 1>&2; 42 echo "Usage: ${0} auto" 1>&2;
43 exit 1; 43 exit 1;
44fi; 44fi;
45SCRIPT=$0
45SRCDIR=$1; 46SRCDIR=$1;
47OUTDIR=$2;
46 48
47 49
48# determines script directory 50# determines script directory
49SCRIPT_DIR=`dirname ${0}` 51SCRIPT_DIR=`dirname ${SCRIPT} |sed -e 's/build-aux\/.*$/build-aux/g' -e 's/\/$//g'`
50SCRIPT_DIR=`echo ${SCRIPT_DIR} |sed -e 's/build-aux\/.*$/build-aux/g' -e 's/\/$//g'`
51 52
52 53
53# determines top of Git directory 54# determines top of Git directory
@@ -56,7 +57,7 @@ if test "x${GIT_TOP_DIR}" == "x" && test "x${SRCDIR}" == "xauto";then
56 GIT_TOP_DIR=`( cd ${SRCDIR} 2> /dev/null && git rev-parse --show-toplevel 2> /dev/null; )` 57 GIT_TOP_DIR=`( cd ${SRCDIR} 2> /dev/null && git rev-parse --show-toplevel 2> /dev/null; )`
57fi 58fi
58if test "x${GIT_TOP_DIR}" == "x" && test "x${SRCDIR}" == "xauto";then 59if test "x${GIT_TOP_DIR}" == "x" && test "x${SRCDIR}" == "xauto";then
59 echo "${0}: unable to determine top level of git repository." 1>&2; 60 echo "${SCRIPT}: unable to determine top level of git repository." 1>&2;
60 exit 0; 61 exit 0;
61elif test "x${GIT_TOP_DIR}" == "x";then 62elif test "x${GIT_TOP_DIR}" == "x";then
62 GIT_TOP_DIR=${SRCDIR} 63 GIT_TOP_DIR=${SRCDIR}
@@ -69,7 +70,7 @@ if test "x${SRCDIR}" == "xauto";then
69 SRCDIR="${GIT_TOP_DIR}" 70 SRCDIR="${GIT_TOP_DIR}"
70fi 71fi
71if test "x${SRCDIR}" == "x";then 72if test "x${SRCDIR}" == "x";then
72 echo "${0}: unable to detect root of source directory." 1>&2; 73 echo "${SCRIPT}: unable to detect root of source directory." 1>&2;
73 exit 1; 74 exit 1;
74fi 75fi
75 76
@@ -95,9 +96,9 @@ if test "x${PACKAGE_TARNAME}" == "x";then
95 fi 96 fi
96 fi 97 fi
97 if test "x${PACKAGE_TARNAME}" == "x";then 98 if test "x${PACKAGE_TARNAME}" == "x";then
98 echo "${0}: WARNING: missing \"${BUILD_AUX}/git-tar-name.txt\"" 1>&2; 99 echo "${SCRIPT}: WARNING: missing \"${BUILD_AUX}/git-tar-name.txt\"" 1>&2;
99 echo "${0}: WARNING: It is advised to create a \"git-tar-name.txt\"" 1>&2; 100 echo "${SCRIPT}: WARNING: It is advised to create a \"git-tar-name.txt\"" 1>&2;
100 echo "${0}: WARNING: file containing the tar name of the package." 1>&2; 101 echo "${SCRIPT}: WARNING: file containing the tar name of the package." 1>&2;
101 fi 102 fi
102fi 103fi
103if test "x${PACKAGE_TARNAME}" == "x";then 104if test "x${PACKAGE_TARNAME}" == "x";then
@@ -106,10 +107,9 @@ fi
106 107
107 108
108# determines output dir 109# determines output dir
109if test "x${2}" != "x";then 110if test "x${OUTDIR}" != "x";then
110 OUTDIR="${2}"
111 if test ! -d "${OUTDIR}";then 111 if test ! -d "${OUTDIR}";then
112 echo "${0}: ${OUTDIR}: directory does not exist" 1>&2; 112 echo "${SCRIPT}: ${OUTDIR}: directory does not exist" 1>&2;
113 exit 1; 113 exit 1;
114 fi 114 fi
115else 115else
@@ -127,10 +127,10 @@ else
127 127
128 # use script directory for headers 128 # use script directory for headers
129 else 129 else
130 OUTDIR=`dirname ${0}` 130 OUTDIR=`dirname ${SCRIPT}`
131 OUTDIR=`echo ${OUTDIR} |sed -e 's/build-aux\/.*$/build-aux/g' -e 's/\/$//g'` 131 OUTDIR=`echo ${OUTDIR} |sed -e 's/build-aux\/.*$/build-aux/g' -e 's/\/$//g'`
132 if test ! -d "${OUTDIR}";then 132 if test ! -d "${OUTDIR}";then
133 echo "${0}: unable to determine output directory." 1>&2 133 echo "${SCRIPT}: unable to determine output directory." 1>&2
134 exit 1; 134 exit 1;
135 fi 135 fi
136 fi 136 fi
@@ -208,7 +208,7 @@ if test "x${GVS}" != "x";then
208elif test "x${GCS}" != "x";then 208elif test "x${GCS}" != "x";then
209 echo "${GCS}"; 209 echo "${GCS}";
210else 210else
211 echo "${GVS}"; 211 echo "unknown version";
212fi 212fi
213 213
214 214