.. | .. |
---|
62 | 62 | fi |
---|
63 | 63 | |
---|
64 | 64 | # Check for git and a git repo. |
---|
65 | | - if test -z "$(git rev-parse --show-cdup 2>/dev/null)" && |
---|
66 | | - head=$(git rev-parse --verify HEAD 2>/dev/null); then |
---|
| 65 | + if head=$(git rev-parse --verify HEAD 2>/dev/null); then |
---|
67 | 66 | |
---|
68 | 67 | if [ -n "$android_release" ] && [ -n "$kmi_generation" ]; then |
---|
69 | 68 | printf '%s' "-$android_release-$kmi_generation" |
---|
.. | .. |
---|
73 | 72 | |
---|
74 | 73 | # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore |
---|
75 | 74 | # it, because this version is defined in the top level Makefile. |
---|
76 | | - if [ -z "`git describe --exact-match 2>/dev/null`" ]; then |
---|
| 75 | + if [ -z "$(git describe --exact-match 2>/dev/null)" ]; then |
---|
77 | 76 | |
---|
78 | 77 | # If only the short version is requested, don't bother |
---|
79 | 78 | # running further git commands |
---|
.. | .. |
---|
105 | 104 | |
---|
106 | 105 | # Is this git on svn? |
---|
107 | 106 | if git config --get svn-remote.svn.url >/dev/null; then |
---|
108 | | - printf -- '-svn%s' "`git svn find-rev $head`" |
---|
| 107 | + printf -- '-svn%s' "$(git svn find-rev $head)" |
---|
109 | 108 | fi |
---|
110 | 109 | |
---|
111 | 110 | # Check for uncommitted changes. |
---|
.. | .. |
---|
126 | 125 | fi |
---|
127 | 126 | |
---|
128 | 127 | # Check for mercurial and a mercurial repo. |
---|
129 | | - if test -d .hg && hgid=`hg id 2>/dev/null`; then |
---|
| 128 | + if hgid=$(hg id 2>/dev/null); then |
---|
130 | 129 | # Do we have an tagged version? If so, latesttagdistance == 1 |
---|
131 | | - if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; then |
---|
132 | | - id=`hg log -r . --template '{latesttag}'` |
---|
| 130 | + if [ "$(hg log -r . --template '{latesttagdistance}')" = "1" ]; then |
---|
| 131 | + id=$(hg log -r . --template '{latesttag}') |
---|
133 | 132 | printf '%s%s' -hg "$id" |
---|
134 | 133 | else |
---|
135 | | - tag=`printf '%s' "$hgid" | cut -d' ' -f2` |
---|
| 134 | + tag=$(printf '%s' "$hgid" | cut -d' ' -f2) |
---|
136 | 135 | if [ -z "$tag" -o "$tag" = tip ]; then |
---|
137 | | - id=`printf '%s' "$hgid" | sed 's/[+ ].*//'` |
---|
| 136 | + id=$(printf '%s' "$hgid" | sed 's/[+ ].*//') |
---|
138 | 137 | printf '%s%s' -hg "$id" |
---|
139 | 138 | fi |
---|
140 | 139 | fi |
---|
.. | .. |
---|
150 | 149 | fi |
---|
151 | 150 | |
---|
152 | 151 | # Check for svn and a svn repo. |
---|
153 | | - if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then |
---|
154 | | - rev=`echo $rev | awk '{print $NF}'` |
---|
| 152 | + if rev=$(LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'); then |
---|
| 153 | + rev=$(echo $rev | awk '{print $NF}') |
---|
155 | 154 | printf -- '-svn%s' "$rev" |
---|
156 | 155 | |
---|
157 | 156 | # All done with svn |
---|
.. | .. |
---|
161 | 160 | |
---|
162 | 161 | collect_files() |
---|
163 | 162 | { |
---|
164 | | - local file res |
---|
| 163 | + local file res= |
---|
165 | 164 | |
---|
166 | 165 | for file; do |
---|
167 | 166 | case "$file" in |
---|