|
@@ -12,9 +12,10 @@ __die_if() {
|
12
|
12
|
|| die "cannot do this outside git repo"
|
13
|
13
|
;;
|
14
|
14
|
norelbr)
|
|
15
|
+ local relsrc=$(ini 1value project:relsrc)
|
15
|
16
|
__git_info curbranch \
|
16
|
|
- | grep -qFx "$RELSRC" \
|
17
|
|
- || die "you are not on RELSRC branch: $RELSRC"
|
|
17
|
+ | grep -qFx "$relsrc" \
|
|
18
|
+ || die "you are not on release source branch: $relsrc"
|
18
|
19
|
;;
|
19
|
20
|
dirty)
|
20
|
21
|
git diff --shortstat 2>/dev/null \
|
|
@@ -28,8 +29,8 @@ __die_if() {
|
28
|
29
|
;;
|
29
|
30
|
nobump)
|
30
|
31
|
git diff-tree --no-commit-id --name-only -r HEAD \
|
31
|
|
- | grep -qFx config.mk \
|
32
|
|
- || die "last change must be version bump in config.mk"
|
|
32
|
+ | grep -qFx mkit.ini \
|
|
33
|
+ || die "last change must be version bump in mkit.ini"
|
33
|
34
|
;;
|
34
|
35
|
wip)
|
35
|
36
|
__git_info reldiff \
|
|
@@ -40,7 +41,7 @@ __die_if() {
|
40
|
41
|
x=$(__ver_info nextver_g)
|
41
|
42
|
__ver_info currver_c \
|
42
|
43
|
| grep -qFx "$x" \
|
43
|
|
- || die "new version not in config.mk: $x"
|
|
44
|
+ || die "new version not in mkit.ini: $x"
|
44
|
45
|
;;
|
45
|
46
|
esac
|
46
|
47
|
}
|
|
@@ -53,7 +54,7 @@ __git_info() {
|
53
|
54
|
case "$info" in
|
54
|
55
|
lasttag) git tag | grep ^v | sort -V | tail -n1 ;;
|
55
|
56
|
curbranch) git rev-parse --abbrev-ref HEAD ;;
|
56
|
|
- reldiff) git log --oneline "$(__git_info lasttag)..HEAD" ;;
|
|
57
|
+ reldiff) git log --oneline "$(__git_info lasttag)..HEAD" --name-only ;;
|
57
|
58
|
esac
|
58
|
59
|
}
|
59
|
60
|
|
|
@@ -65,8 +66,7 @@ __ver_info() {
|
65
|
66
|
case "$info" in
|
66
|
67
|
lastver_g) __git_info lasttag | sed s/^v// ;;
|
67
|
68
|
nextver_g) __make_ver "$level" "$(__ver_info lastver_g)" ;;
|
68
|
|
- currver_c) grep -m 1 -w VERSION config.mk \
|
69
|
|
- | sed 's/ *= */=/' | cut -d = -f 2 | xargs echo ;;
|
|
69
|
+ currver_c) ini 1value project:version ;;
|
70
|
70
|
nextver_c) __make_ver "$level" "$(__ver_info currver_c)" ;;
|
71
|
71
|
esac
|
72
|
72
|
}
|
|
@@ -94,7 +94,7 @@ __release() {
|
94
|
94
|
# Span release routines: make a signed tag, check branch
|
95
|
95
|
# and update release branch
|
96
|
96
|
#
|
97
|
|
- # FIXME: Using PRERELEASE as build.sh:get_version() does may not be
|
|
97
|
+ # FIXME: Using project:prerl as build.sh:get_version() does may not be
|
98
|
98
|
# compatible with this release strategy
|
99
|
99
|
#
|
100
|
100
|
local level=$1
|
|
@@ -112,19 +112,26 @@ __release() {
|
112
|
112
|
set -e
|
113
|
113
|
debug_var newtag
|
114
|
114
|
$MKIT_DRY && return
|
115
|
|
- git tag -m "$MKIT_PROJNAME $newtag - $CODENAME" "$newtag"
|
116
|
|
- git branch -f "$RELDST" "$newtag"
|
|
115
|
+ git tag -m "$MKIT_PROJ_NAME $newtag - $CODENAME" "$newtag"
|
|
116
|
+ git branch -f "$(ini 1value project:reldst)" "$newtag"
|
117
|
117
|
}
|
118
|
118
|
|
119
|
119
|
__git_msg_vbump() {
|
120
|
120
|
echo "Bump version"
|
121
|
121
|
echo ""
|
122
|
|
- __git_info reldiff | sed 's/^/ * /'
|
|
122
|
+ echo "Overview of changes:"
|
|
123
|
+ echo ""
|
|
124
|
+ __git_info reldiff \
|
|
125
|
+ | sed '
|
|
126
|
+ s/^[a-f0-9]\{7\} / * &/; t PATHS
|
|
127
|
+ s/^/ /
|
|
128
|
+ :PATHS
|
|
129
|
+ '
|
123
|
130
|
}
|
124
|
131
|
|
125
|
132
|
__vbump() {
|
126
|
133
|
local level="$1"
|
127
|
|
- local lastver # current from config.mk
|
|
134
|
+ local lastver # current from mkit.ini
|
128
|
135
|
local nextver # after the bump
|
129
|
136
|
__die_if nogit
|
130
|
137
|
__die_if norelbr
|
|
@@ -133,10 +140,10 @@ __vbump() {
|
133
|
140
|
nextver=$(__ver_info nextver_c)
|
134
|
141
|
debug_var lastver nextver
|
135
|
142
|
$MKIT_DRY && return
|
136
|
|
- sed -i "s/$lastver/$nextver/" config.mk \
|
137
|
|
- || die "failed to update config.mk"
|
138
|
|
- git add config.mk \
|
139
|
|
- || die "failed to add config.mk to the index"
|
|
143
|
+ update_version "$nextver" mkit.ini \
|
|
144
|
+ || die "failed to update version in mkit.ini"
|
|
145
|
+ git add mkit.ini \
|
|
146
|
+ || die "failed to add mkit.ini to the index"
|
140
|
147
|
git commit -e -m "$(__git_msg_vbump)"
|
141
|
148
|
}
|
142
|
149
|
|