4
headers[crmcommon]="include/crm/common include/crm/crm.h"
5
headers[crmcluster]="include/crm/cluster.h"
6
headers[transitioner]="include/crm/transition.h"
7
headers[cib]="include/crm/cib.h include/crm/cib/util.h"
8
headers[pe_rules]="include/crm/pengine/rules.h"
9
headers[pe_status]="include/crm/pengine/common.h include/crm/pengine/complex.h include/crm/pengine/rules.h include/crm/pengine/status.h"
10
headers[pengine]="include/crm/pengine/common.h include/crm/pengine/complex.h include/crm/pengine/rules.h include/crm/pengine/status.h"
11
headers[stonithd]="include/crm/stonith-ng.h"
12
headers[lrmd]="include/crm/lrmd.h"
14
LAST_RELEASE=`test -e /Volumes || git tag -l | grep Pacemaker | sort -Vr | head -n 1`
15
for lib in crmcommon crmcluster transitioner cib pe_rules pe_status stonithd pengine lrmd; do
16
git diff -w $LAST_RELEASE..HEAD ${headers[$lib]}
19
am=`find . -name Makefile.am -exec grep -lr "lib${lib}_la.*version-info" \{\} \;`
23
grep "lib${lib}_la_SOURCES.*\\\\" $am
25
echo -e "\033[1;35m -- Sources list for lib$lib is probably truncated! --\033[0m"
29
sources=`grep "lib${lib}_la_SOURCES" $am | sed s/.*=// | sed 's:$(top_builddir)/::' | sed 's:$(top_srcdir)/::' | sed 's:\\\::' | sed 's:$(libpe_rules_la_SOURCES):rules.c\ common.c:'`
35
full_sources="$full_sources $f"
37
full_sources="$full_sources $am_dir/$f"
41
lines=`git diff -w $LAST_RELEASE..HEAD ${headers[$lib]} $full_sources | wc -l`
43
if [ $lines -gt 0 ]; then
44
echo "- Headers: ${headers[$lib]}"
45
echo "- Sources: $full_sources"
46
echo "- Changed Sources since $LAST_RELEASE:"
47
git diff -w $LAST_RELEASE..HEAD --stat $full_sources
49
read -p "Are the changes to lib$lib: [a]dditions, [r]emovals or [f]ixes? [None]: " CHANGE
51
git show $LAST_RELEASE:$am | grep version-info
52
VER=`git show $LAST_RELEASE:$am | grep "lib.*${lib}_la.*version-info" | sed s/.*version-info// | awk '{print $1}'`
53
VER_NOW=`grep "lib.*${lib}_la.*version-info" $am | sed s/.*version-info// | awk '{print $1}'`
54
VER_1=`echo $VER | awk -F: '{print $1}'`
55
VER_2=`echo $VER | awk -F: '{print $2}'`
56
VER_3=`echo $VER | awk -F: '{print $3}'`
57
VER_1_NOW=`echo $VER_NOW | awk -F: '{print $1}'`
61
echo "New version with backwards compatible extensions: x+1:0:z+1"
62
VER_1=`expr $VER_1 + 1`
64
VER_3=`expr $VER_3 + 1`
67
echo "New backwards incompatible version: x+1:0:0"
68
VER_1=`expr $VER_1 + 1`
71
for h in ${headers[$lib]}; do
72
sed -i.sed "s/lib${lib}.so.${VER_1_NOW}/lib${lib}.so.${VER_1}/" $h
76
echo "Bugfix: x:y+1:z"
77
VER_2=`expr $VER_2 + 1`
80
VER_NEW=$VER_1:$VER_2:$VER_3
82
if [ ! -z $CHANGE ]; then
83
if [ $VER_NEW != $VER_NOW ]; then
84
echo "Updating $lib library version: $VER -> $VER_NEW"
85
sed -i.sed "s/version-info\ $VER_NOW/version-info\ $VER_NEW/" $am
87
echo "No further version changes needed"
90
echo "Skipping $lib version"
93
echo "No changes to $lib interface"