History

Fix quoting in version.sh

Mans Rullgard committed 16 years ago

Commit f318ee31 parent daed21a1 file · +10 −10Browse files

Unified · Split

version.sh+10−10
@@ -2,32 +2,32 @@ · 1 unmodified line
22
33 # check for SVN revision number
44 revision=$(cd "$1" && cat snapshot_version 2> /dev/null)
5−test $revision || revision=$(cd "$1" && LC_ALL=C svn info 2> /dev/null | grep "Last Changed Rev" | cut -d' ' -f4)
6−test $revision || revision=$(cd "$1" && grep committed-rev .svn/entries 2>/dev/null | head -n 1 | cut -d '"' -f2)
7−test $revision || revision=$(cd "$1" && sed -n -e '/^dir$/{n
5+test "$revision" || revision=$(cd "$1" && LC_ALL=C svn info 2> /dev/null | grep "Last Changed Rev" | cut -d' ' -f4)
6+test "$revision" || revision=$(cd "$1" && grep committed-rev .svn/entries 2>/dev/null | head -n 1 | cut -d '"' -f2)
7+test "$revision" || revision=$(cd "$1" && sed -n -e '/^dir$/{n
88 p
99 q
1010 }' .svn/entries 2>/dev/null)
11−test $revision && revision=SVN-r$revision
11+test "$revision" && revision=SVN-r$revision
1212
1313 # check for git svn revision number
14−if ! test $revision; then
14+if ! test "$revision"; then
1515 revision=$(cd "$1" && git svn find-rev HEAD 2> /dev/null)
16− test $revision && revision=git-svn-r$revision
16+ test "$revision" && revision=git-svn-r$revision
1717 fi
1818
1919 # check for git short hash
20−if ! test $revision; then
20+if ! test "$revision"; then
2121 revision=$(cd "$1" && git describe --always 2> /dev/null)
22− test $revision && revision=git-$revision
22+ test "$revision" && revision=git-$revision
2323 fi
2424
2525 # no revision number found
26−test $revision || revision=UNKNOWN
26+test "$revision" || revision=UNKNOWN
2727
2828 # releases extract the version number from the VERSION file
2929 version=$(cd "$1" && cat VERSION 2> /dev/null)
30−test $version || version=$revision
30+test "$version" || version=$revision
3131
3232 test -n "$3" && version=$version-$3
3333

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t