diff options
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-x | scripts/setlocalversion | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index d6a866ed1835..64a9cb5556cd 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -10,13 +10,13 @@ | |||
10 | # | 10 | # |
11 | 11 | ||
12 | usage() { | 12 | usage() { |
13 | echo "Usage: $0 [--scm-only] [srctree]" >&2 | 13 | echo "Usage: $0 [--save-scmversion] [srctree]" >&2 |
14 | exit 1 | 14 | exit 1 |
15 | } | 15 | } |
16 | 16 | ||
17 | scm_only=false | 17 | scm_only=false |
18 | srctree=. | 18 | srctree=. |
19 | if test "$1" = "--scm-only"; then | 19 | if test "$1" = "--save-scmversion"; then |
20 | scm_only=true | 20 | scm_only=true |
21 | shift | 21 | shift |
22 | fi | 22 | fi |
@@ -30,11 +30,12 @@ fi | |||
30 | 30 | ||
31 | scm_version() | 31 | scm_version() |
32 | { | 32 | { |
33 | local short=false | 33 | local short |
34 | short=false | ||
34 | 35 | ||
35 | cd "$srctree" | 36 | cd "$srctree" |
36 | if test -e .scmversion; then | 37 | if test -e .scmversion; then |
37 | cat "$_" | 38 | cat .scmversion |
38 | return | 39 | return |
39 | fi | 40 | fi |
40 | if test "$1" = "--short"; then | 41 | if test "$1" = "--short"; then |
@@ -131,12 +132,15 @@ collect_files() | |||
131 | } | 132 | } |
132 | 133 | ||
133 | if $scm_only; then | 134 | if $scm_only; then |
134 | scm_version | 135 | if test ! -e .scmversion; then |
136 | res=$(scm_version) | ||
137 | echo "$res" >.scmversion | ||
138 | fi | ||
135 | exit | 139 | exit |
136 | fi | 140 | fi |
137 | 141 | ||
138 | if test -e include/config/auto.conf; then | 142 | if test -e include/config/auto.conf; then |
139 | source "$_" | 143 | . include/config/auto.conf |
140 | else | 144 | else |
141 | echo "Error: kernelrelease not valid - run 'make prepare' to update it" | 145 | echo "Error: kernelrelease not valid - run 'make prepare' to update it" |
142 | exit 1 | 146 | exit 1 |