aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/version.sh')
-rw-r--r--fs/btrfs/version.sh34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/btrfs/version.sh b/fs/btrfs/version.sh
index 0f57f24404d9..1ca1952fd917 100644
--- a/fs/btrfs/version.sh
+++ b/fs/btrfs/version.sh
@@ -8,24 +8,24 @@
8 8
9v="v0.16" 9v="v0.16"
10 10
11which hg > /dev/null 11which git &> /dev/null
12if [ -d .hg ] && [ $? == 0 ]; then 12if [ $? == 0 ]; then
13 last=$(hg tags | grep -m1 -o '^v[0-9.]\+') 13 git branch >& /dev/null
14 14 if [ $? == 0 ]; then
15 # now check if the repo has commits since then... 15 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
16 if [[ $(hg id -t) == $last || \ 16 if tag=`git describe --tags 2>/dev/null`; then
17 $(hg di -r "$last:." | awk '/^diff/{print $NF}' | sort -u) == .hgtags ]] 17 v="$tag"
18 then 18 fi
19 # check if it's dirty 19
20 if [[ $(hg id | cut -d' ' -f1) == *+ ]]; then 20 # Are there uncommitted changes?
21 v=$last+ 21 git update-index --refresh --unmerged > /dev/null
22 else 22 if git diff-index --name-only HEAD | \
23 v=$last 23 grep -v "^scripts/package" \
24 | read dummy; then
25 v="$v"-dirty
26 fi
24 fi 27 fi
25 else 28 fi
26 # includes dirty flag
27 v=$last+$(hg id -i)
28 fi
29fi 29fi
30 30
31echo "#ifndef __BUILD_VERSION" > .build-version.h 31echo "#ifndef __BUILD_VERSION" > .build-version.h