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
2 2
3# check for SVN revision number3# check for SVN revision number
4revision=$(cd "$1" && cat snapshot_version 2> /dev/null)4revision=$(cd "$1" && cat snapshot_version 2> /dev/null)
5test $revision || revision=$(cd "$1" && LC_ALL=C svn info 2> /dev/null | grep "Last Changed Rev" | cut -d' ' -f4)5test "$revision" || revision=$(cd "$1" && LC_ALL=C svn info 2> /dev/null | grep "Last Changed Rev" | cut -d' ' -f4)
6test $revision || revision=$(cd "$1" && grep committed-rev .svn/entries 2>/dev/null | head -n 1 | cut -d '"' -f2)6test "$revision" || revision=$(cd "$1" && grep committed-rev .svn/entries 2>/dev/null | head -n 1 | cut -d '"' -f2)
7test $revision || revision=$(cd "$1" && sed -n -e '/^dir$/{n7test "$revision" || revision=$(cd "$1" && sed -n -e '/^dir$/{n
8p8p
9q9q
10}' .svn/entries 2>/dev/null)10}' .svn/entries 2>/dev/null)
11test $revision && revision=SVN-r$revision11test "$revision" && revision=SVN-r$revision
12 12
13# check for git svn revision number13# check for git svn revision number
14if ! test $revision; then14if ! test "$revision"; then
15 revision=$(cd "$1" && git svn find-rev HEAD 2> /dev/null)15 revision=$(cd "$1" && git svn find-rev HEAD 2> /dev/null)
16 test $revision && revision=git-svn-r$revision16 test "$revision" && revision=git-svn-r$revision
17fi17fi
18 18
19# check for git short hash19# check for git short hash
20if ! test $revision; then20if ! test "$revision"; then
21 revision=$(cd "$1" && git describe --always 2> /dev/null)21 revision=$(cd "$1" && git describe --always 2> /dev/null)
22 test $revision && revision=git-$revision22 test "$revision" && revision=git-$revision
23fi23fi
24 24
25# no revision number found25# no revision number found
26test $revision || revision=UNKNOWN26test "$revision" || revision=UNKNOWN
27 27
28# releases extract the version number from the VERSION file28# releases extract the version number from the VERSION file
29version=$(cd "$1" && cat VERSION 2> /dev/null)29version=$(cd "$1" && cat VERSION 2> /dev/null)
30test $version || version=$revision30test "$version" || version=$revision
31 31
32test -n "$3" && version=$version-$332test -n "$3" && version=$version-$3
33 33

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