summaryrefslogtreecommitdiffstats
path: root/tools/extract-api.sh
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-16 18:13:32 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-16 18:13:32 +0200
commit56af88aeceb10b0c66f4a26227e8980654c6c587 (patch)
tree3187b9d44ef9aac1cc23e3d0608ced696e91c430 /tools/extract-api.sh
parentbf681e9e90adf99357f754284703ea2c6dc3ff4e (diff)
downloadffi-efl-56af88aeceb10b0c66f4a26227e8980654c6c587.zip
ffi-efl-56af88aeceb10b0c66f4a26227e8980654c6c587.tar.gz
add gitignore, extract api into ./tools/api
Diffstat (limited to 'tools/extract-api.sh')
-rwxr-xr-xtools/extract-api.sh26
1 files changed, 15 insertions, 11 deletions
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
index 9fa7320..406c033 100755
--- a/tools/extract-api.sh
+++ b/tools/extract-api.sh
@@ -1,9 +1,11 @@
#! /bin/bash
#
-# TODO : use pkg-config
-#
+CURRENT=$(dirname $0)/api
+PREV=$(dirname $0)/api-prev
INCLUDE=$(pkg-config --libs ecore |gawk '{ print substr($1,3) }' | sed s/lib/include/)
#
+[ ! -d $PREV ] && mkdir $PREV
+[ ! -d $CURRENT ] && mkdir $CURRENT
rm *-diff 2>/dev/null
#
for header in \
@@ -22,16 +24,18 @@ for header in \
DIR=$(dirname $header)
FILE=$(basename $header)
#
- [ -f $FILE ] && mv $FILE $FILE.prev
+ mv $CURRENT/$FILE-* $PREV/ 2>/dev/null
#
- cat $header | sed -n -f sed-functions > $FILE
- cat $header | sed -r -n -f sed-enums > $FILE-enum
- cat $header | sed -r -n -f sed-structs > $FILE-structs
+ cat $header | sed -r -n -f sed-functions > $CURRENT/$FILE-funcs
+ cat $header | sed -r -n -f sed-enums > $CURRENT/$FILE-enums
+ cat $header | sed -r -n -f sed-structs > $CURRENT/$FILE-structs
#
- if [ -f $FILE.prev ]; then
- diff -u0 $FILE.prev $FILE > $FILE-diff
- N=$(cat $FILE-diff | wc -l)
- [ $N -eq 0 ] && rm $FILE-diff
- fi
+ for F in $FILE-funcs $FILE-enums $FILE-structs ; do
+ if [ -f $PREV/$F ]; then
+ diff -u0 $PREV/$F $CURRENT/$F > $F-diff
+ N=$(cat $F-diff | wc -l)
+ [ $N -eq 0 ] && rm $F-diff
+ fi
+ done
#
done