root/tools/bump_release.sh

Revision 2841, 0.7 kB (checked in by cpebenito, 1 month ago)

tools: fix bump_release.sh to catch generated modules (i.e. corenetwork)

  • Property svn:executable set to *
Line 
1 #!/bin/bash
2
3 # update version numbers for a release
4
5 if [ ! -d policy/modules ]; then
6         echo "Must run this from the root of the policy source."
7         exit 1
8 fi
9
10 for i in $(find policy/modules -iname "*.te") $(find policy/modules -iname "*.te.in"); do
11         VERSION=`grep '^policy_module' $i | m4 -D policy_module='$2'`
12         MAJOR=`echo $VERSION | cut -d. -f1`
13         MINOR=`echo $VERSION | cut -d. -f2`
14         REV=`echo $VERSION | cut -d. -f3`
15         [ -z "$REV" ] && REV="0"
16
17         if [ "$REV" != "0" ]; then
18                 NEWMINOR=$(( $MINOR + 1 ))
19                 sed -i -e "/^policy_module/s/$MAJOR.$MINOR.$REV/$MAJOR.$NEWMINOR.0/" $i
20                 echo `basename $i`:$MAJOR.$NEWMINOR.0
21
22                 # add in a space after the comma, if its missing
23                 sed -i -r -e "/^policy_module[^,]+,[^ ]/s/,/, /" $i
24         fi
25 done
Note: See TracBrowser for help on using the browser.