Skip to content

Commit 3fb7f71

Browse files
committed
Build: Ensure we track libraries as they are added
1 parent 514bffa commit 3fb7f71

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

bumplibs.sh

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare -A headers
44
headers[crmcommon]="include/crm/common include/crm/crm.h"
55
headers[crmcluster]="include/crm/cluster.h"
6+
headers[crmservice]="include/crm/services.h"
67
headers[transitioner]="include/crm/transition.h"
78
headers[cib]="include/crm/cib.h include/crm/cib/util.h"
89
headers[pe_rules]="include/crm/pengine/rules.h"
@@ -11,8 +12,17 @@ headers[pengine]="include/crm/pengine/common.h include/crm/pengine/complex.h i
1112
headers[stonithd]="include/crm/stonith-ng.h"
1213
headers[lrmd]="include/crm/lrmd.h"
1314

14-
LAST_RELEASE=`test -e /Volumes || git tag -l | grep Pacemaker | grep -v rc | sort -Vr | head -n 1`
15-
for lib in crmcommon crmcluster transitioner cib pe_rules pe_status stonithd pengine lrmd; do
15+
if [ ! -z $1 ]; then
16+
LAST_RELEASE=$1
17+
else
18+
LAST_RELEASE=`test -e /Volumes || git tag -l | grep Pacemaker | grep -v rc | sort -Vr | head -n 1`
19+
fi
20+
libs=$(find . -name "*.am" -exec grep "lib.*_la_LDFLAGS.*version-info" \{\} \; | sed -e s/_la_LDFLAGS.*// -e s/^lib//)
21+
for lib in $libs; do
22+
if [ -z "${headers[$lib]}" ]; then
23+
echo "Unknown headers for lib$lib"
24+
exit 0
25+
fi
1626
git diff -w $LAST_RELEASE..HEAD ${headers[$lib]}
1727
echo ""
1828

@@ -27,6 +37,7 @@ for lib in crmcommon crmcluster transitioner cib pe_rules pe_status stonithd pen
2737
fi
2838

2939
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:'`
40+
3041
full_sources=""
3142
for f in $sources; do
3243
if
@@ -48,6 +59,11 @@ for lib in crmcommon crmcluster transitioner cib pe_rules pe_status stonithd pen
4859
echo ""
4960
echo "New arguments to functions or changes to the middle of structs are incompatible additions"
5061
echo ""
62+
echo "Where possible:"
63+
echo "- move new fields to the end of structs"
64+
echo "- use bitfields instead of booleans"
65+
echo "- when adding arguments, create new functions that the old version can call"
66+
echo ""
5167
read -p "Are the changes to lib$lib: [a]dditions, [i]ncompatible additions, [r]emovals or [f]ixes? [None]: " CHANGE
5268

5369
git show $LAST_RELEASE:$am | grep version-info

0 commit comments

Comments
 (0)