mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-19 16:17:40 +00:00
scripts: setlocalversion: replace backquote to dollar parenthesis
This patch replaces backquote to dollar parenthesis syntax for better readability. Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Nico Schottelius <nico-linuxsetlocalversion@schottelius.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
03034dbdae
commit
3c96bdd0eb
@ -45,11 +45,11 @@ scm_version()
|
|||||||
|
|
||||||
# Check for git and a git repo.
|
# Check for git and a git repo.
|
||||||
if test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
|
if test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
|
||||||
head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
|
head=$(git rev-parse --verify --short HEAD 2>/dev/null); then
|
||||||
|
|
||||||
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
|
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
|
||||||
# it, because this version is defined in the top level Makefile.
|
# it, because this version is defined in the top level Makefile.
|
||||||
if [ -z "`git describe --exact-match 2>/dev/null`" ]; then
|
if [ -z "$(git describe --exact-match 2>/dev/null)" ]; then
|
||||||
|
|
||||||
# If only the short version is requested, don't bother
|
# If only the short version is requested, don't bother
|
||||||
# running further git commands
|
# running further git commands
|
||||||
@ -59,7 +59,7 @@ scm_version()
|
|||||||
fi
|
fi
|
||||||
# If we are past a tagged commit (like
|
# If we are past a tagged commit (like
|
||||||
# "v2.6.30-rc5-302-g72357d5"), we pretty print it.
|
# "v2.6.30-rc5-302-g72357d5"), we pretty print it.
|
||||||
if atag="`git describe 2>/dev/null`"; then
|
if atag="$(git describe 2>/dev/null)"; then
|
||||||
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
|
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
|
||||||
|
|
||||||
# If we don't have a tag at all we print -g{commitish}.
|
# If we don't have a tag at all we print -g{commitish}.
|
||||||
@ -70,7 +70,7 @@ scm_version()
|
|||||||
|
|
||||||
# Is this git on svn?
|
# Is this git on svn?
|
||||||
if git config --get svn-remote.svn.url >/dev/null; then
|
if git config --get svn-remote.svn.url >/dev/null; then
|
||||||
printf -- '-svn%s' "`git svn find-rev $head`"
|
printf -- '-svn%s' "$(git svn find-rev $head)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for uncommitted changes.
|
# Check for uncommitted changes.
|
||||||
@ -91,15 +91,15 @@ scm_version()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for mercurial and a mercurial repo.
|
# Check for mercurial and a mercurial repo.
|
||||||
if test -d .hg && hgid=`hg id 2>/dev/null`; then
|
if test -d .hg && hgid=$(hg id 2>/dev/null); then
|
||||||
# Do we have an tagged version? If so, latesttagdistance == 1
|
# Do we have an tagged version? If so, latesttagdistance == 1
|
||||||
if [ "`hg log -r . --template '{latesttagdistance}'`" = "1" ]; then
|
if [ "$(hg log -r . --template '{latesttagdistance}')" = "1" ]; then
|
||||||
id=`hg log -r . --template '{latesttag}'`
|
id=$(hg log -r . --template '{latesttag}')
|
||||||
printf '%s%s' -hg "$id"
|
printf '%s%s' -hg "$id"
|
||||||
else
|
else
|
||||||
tag=`printf '%s' "$hgid" | cut -d' ' -f2`
|
tag=$(printf '%s' "$hgid" | cut -d' ' -f2)
|
||||||
if [ -z "$tag" -o "$tag" = tip ]; then
|
if [ -z "$tag" -o "$tag" = tip ]; then
|
||||||
id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
|
id=$(printf '%s' "$hgid" | sed 's/[+ ].*//')
|
||||||
printf '%s%s' -hg "$id"
|
printf '%s%s' -hg "$id"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -115,8 +115,8 @@ scm_version()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for svn and a svn repo.
|
# Check for svn and a svn repo.
|
||||||
if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
|
if rev=$(LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'); then
|
||||||
rev=`echo $rev | awk '{print $NF}'`
|
rev=$(echo $rev | awk '{print $NF}')
|
||||||
printf -- '-svn%s' "$rev"
|
printf -- '-svn%s' "$rev"
|
||||||
|
|
||||||
# All done with svn
|
# All done with svn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user