Browse Source

Add version bump/CL helper targets

Alois Mahdal 9 years ago
parent
commit
8fec923786
3 changed files with 47 additions and 4 deletions
  1. 1
    1
      src/include/mkit.sh
  2. 36
    2
      src/include/release.sh
  3. 10
    1
      src/mkit.mk

+ 1
- 1
src/include/mkit.sh View File

71
     # Call correct function based on $1
71
     # Call correct function based on $1
72
     #
72
     #
73
     case $1 in
73
     case $1 in
74
-        build|build_manpages|clean|dist|rpmstuff|install|release_?|uninstall)
74
+        build|build_manpages|clean|dist|rpmstuff|install|release_?|uninstall|vbump_?)
75
             $1
75
             $1
76
             ;;
76
             ;;
77
         *)
77
         *)

+ 36
- 2
src/include/release.sh View File

107
     __die_if wip
107
     __die_if wip
108
     __die_if old_c
108
     __die_if old_c
109
 
109
 
110
-    # FIXME: Have user prepare proper message with changelog
111
-
112
     newtag=v$(__ver_info nextver_g)
110
     newtag=v$(__ver_info nextver_g)
113
     set -e
111
     set -e
114
     debug_var newtag
112
     debug_var newtag
117
     git branch -f "$RELDST" "$newtag"
115
     git branch -f "$RELDST" "$newtag"
118
 }
116
 }
119
 
117
 
118
+__git_msg_vbump() {
119
+    echo "Bump version"
120
+    echo ""
121
+    __git_info reldiff | sed 's/^/ *  '
122
+}
123
+
124
+__vbump() {
125
+    local level="$1"
126
+    local lastver   # current from config.mk
127
+    local nextver   # after the bump
128
+    __die_if nogit
129
+    __die_if norelbr
130
+    __die_if dirty
131
+    lastver=$(__ver_info currver_c)
132
+    nextver=$(__ver_info nextver_c)
133
+    debug_var lastver nextver
134
+    $MKIT_DRY && return
135
+    sed -i "s/$lastver/$nextver/" config.mk \
136
+      || die "failed to update config.mk"
137
+    git add config.mk \
138
+      || die "failed to add config.mk to the index"
139
+    git commit -e -m "$(__git_msg_vbump)"
140
+}
141
+
142
+vbump_x() {
143
+    __vbump x
144
+}
145
+
146
+vbump_y() {
147
+    __vbump y
148
+}
149
+
150
+vbump_z() {
151
+    __vbump z
152
+}
153
+
120
 release_x() {
154
 release_x() {
121
     __release x
155
     __release x
122
 }
156
 }

+ 10
- 1
src/mkit.mk View File

42
 uninstall:
42
 uninstall:
43
 	@$(MKIT_DIR)/make uninstall
43
 	@$(MKIT_DIR)/make uninstall
44
 
44
 
45
-.PHONY: all options clean dist rpmstuff install uninstall release_x release_y release_z
45
+vbump_x:
46
+	@$(MKIT_DIR)/make vbump_x
47
+
48
+vbump_y:
49
+	@$(MKIT_DIR)/make vbump_y
50
+
51
+vbump_z:
52
+	@$(MKIT_DIR)/make vbump_z
53
+
54
+.PHONY: all options clean dist rpmstuff install uninstall release_x release_y release_z vbump_x vbump_y vbump_z