blob: 1f61e4201ae9394eca4ff783321f03649aadaade [file] [log] [blame]
Wes Hardaker0ec088a2010-10-11 14:11:17 +00001#!/bin/sh
2#
3# simplistic script to check all header files for
4# differences. Intended to help detect api changes
5# between releases.
6#
7# it's not pretty or efficient, and inspection of
8# the results must be done manually.
9#
10# it's also not secure (don't run as root)
11# or portable. Tested on Linux.
12#
13
14if [ "x$1" = "x" -o "x$2" = "x" ]; then
15 echo "Usage: $0 <old-dir> <new-dir>"
16 exit 1
17fi
18
19od=$1
20nd=$2
21DIR=/tmp
22OUTPUT=$DIR/api-diff.pat
23ODT=$DIR/api-od
24
25if [ ! -d $od ]; then
26 echo "old dir $od doesn't exist"
27 exit 1
28fi
29
30if [ ! -d $nd ]; then
31 echo "old dir $nd doesn't exist"
32 exit 1
33fi
34
35# find header in nd
36rm -f $OUTPUT $ODT 2>/dev/null
37(cd $od && find . -type f -name "*.h"|sort > $ODT)
38
39OH=`cat $ODT`
40for h in $OH
41do
42 nh=$nd/$h
43 oh=$od/$h
44 echo "* $nh"
45 if [ -f "$nh" ]; then
46 echo "* diff: $h vs $nh" >> $OUTPUT
47 diff -u $oh $nh >> $OUTPUT 2>&1
48 else
49 echo "* Old header $h not found in new headers" >> $OUTPUT
50 fi
51done
52
53echo "Inspect output in $OUTPUT"
54echo "See Makefile.top for libtool version bumping rules."