|
@@ -38,7 +38,7 @@ build1() {
|
38
|
38
|
dstpath=${srcpath%.skel}
|
39
|
39
|
perl -pe "
|
40
|
40
|
s|__EECC_INI_PATH__|$EECC_INI_PATH_GLOBAL:\\\$HOME/$EECC_INI_PATH_USER|;
|
41
|
|
- s|__VERSION__|$VERSION|;
|
|
41
|
+ s|__VERSION__|$(get_version)|;
|
42
|
42
|
" < $srcpath > $dstpath
|
43
|
43
|
echo $dstpath >> built.list
|
44
|
44
|
}
|
|
@@ -60,7 +60,8 @@ clean() {
|
60
|
60
|
}
|
61
|
61
|
|
62
|
62
|
dist() {
|
63
|
|
- local dirname=eecc-${VERSION}
|
|
63
|
+ local version=$(get_version)
|
|
64
|
+ local dirname=eecc-$version
|
64
|
65
|
mkdir -p $dirname
|
65
|
66
|
cp -R bin \
|
66
|
67
|
config.mk \
|
|
@@ -71,10 +72,10 @@ dist() {
|
71
|
72
|
test \
|
72
|
73
|
utils \
|
73
|
74
|
$dirname
|
|
75
|
+ sed -ie "s/^VERSION = .*/VERSION = $version/" $dirname/config.mk
|
74
|
76
|
tar -cf $dirname.tar $dirname
|
75
|
77
|
gzip $dirname.tar
|
76
|
78
|
rm -rf $dirname
|
77
|
|
- echo $dirname.tar.gz >> built.list
|
78
|
79
|
}
|
79
|
80
|
|
80
|
81
|
install() {
|
|
@@ -84,6 +85,36 @@ install() {
|
84
|
85
|
test -f .autoclean && clean || :
|
85
|
86
|
}
|
86
|
87
|
|
|
88
|
+get_version() {
|
|
89
|
+ local version=$VERSION
|
|
90
|
+ local stage=$STAGE
|
|
91
|
+ if git rev-parse HEAD >&/dev/null;
|
|
92
|
+ then
|
|
93
|
+ local lasttag=$(git tag | grep ^v | tail -n1)
|
|
94
|
+ if ! git describe --tags --exact-match HEAD >&/dev/null;
|
|
95
|
+ then
|
|
96
|
+ local sha=g$(git describe --always HEAD)
|
|
97
|
+ fi
|
|
98
|
+ if test "$(git diff --shortstat 2>/dev/null)" != "";
|
|
99
|
+ then
|
|
100
|
+ local dirty=dirty
|
|
101
|
+ fi
|
|
102
|
+ version=${lasttag:1}
|
|
103
|
+ case $stage:$sha:$dirty in
|
|
104
|
+ ::) suffix="" ;;
|
|
105
|
+ ::dirty) suffix="+$dirty" ;;
|
|
106
|
+ :g*:) suffix="+$sha" ;;
|
|
107
|
+ :g*:dirty) suffix="+$sha.dirty" ;;
|
|
108
|
+ *::) suffix="-$stage" ;;
|
|
109
|
+ *::dirty) suffix="-$stage+$dirty" ;;
|
|
110
|
+ *:g*:) suffix="-$stage+$sha" ;;
|
|
111
|
+ *:g*:dirty) suffix="-$stage+$sha.$dirty" ;;
|
|
112
|
+ esac
|
|
113
|
+ version=$version$suffix
|
|
114
|
+ fi
|
|
115
|
+ echo $version
|
|
116
|
+}
|
|
117
|
+
|
87
|
118
|
run_test() {
|
88
|
119
|
pushd test
|
89
|
120
|
find -maxdepth 1 -type f \! -name '*.skel' | while read test;
|