further cleanup and check other missing BUILD-FROM-SRPM
[wextoolbox.git] / check-onelab.sh
1 #!/bin/bash
2
3 # this utility is to compare the current build settings with the one from onelab
4
5 COMMAND=$(basename $0)
6
7 REF=$HOME/git/build
8
9 function usage () {
10     echo "Usage: $COMMAND update|body|tags"
11     echo "update: performs svn up on the mainstream build dir"
12     echo "body: compares the .mk file"
13     echo "tags: compares the tags (taken from k32)"
14     exit 1
15 }
16
17 function update () {
18     echo "Updating $REF"
19     (cd $REF ; git pull)
20     echo "Update done"
21 }
22
23 function check_body () {
24     a=$REF/onelab.mk
25     b=wextoolbox.mk
26     echo "Checking body $a $b"
27     diff -w $a $b | egrep -v '^(<|>)( #| +$)|nozomi|comgt|planetlab-umts-tools|boost|gnuradio|bbn|crunchxml|spectools|sge|iwlwifi|kernelconfig=planetlab|umts|DistributedRateLimiting'
28 }
29
30 function check_tags () {
31     a=$REF/onelab-k32-tags.mk
32     b=wextoolbox-tags.mk
33     echo "Checking tags $a $b"
34     diff -w $REF/onelab-k32-tags.mk wextoolbox-tags.mk | egrep -v '^(<|>) #|SVNBRANCH|nozomi|comgt|planetlab-umts-tools|boost|gnuradio|bbn_80211|crunchxml|spectools|ejabberd|omf|DistributedRateLimiting|openvswitch|sfa-|sface-|^[0-9,c]*$|^---$'
35 }
36
37 [[ -z "$@" ]] && usage
38
39 for arg in "$@" ; do
40     case $arg in
41         up*) update ;;
42         bo*) check_body ;;
43         ta*) check_tags ;;
44         *) usage;;
45     esac
46 done