summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-06-19 18:42:15 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-06-19 18:42:15 +0200
commit39eceb24663e22eeb8783d87dabbc62f21352194 (patch)
tree97f0f32f5ef3b87291450b8a81170b4b8afd7666
parentfd369ac73871ba027298b1d50235267b25bf98d6 (diff)
downloadffi-efl-39eceb24663e22eeb8783d87dabbc62f21352194.zip
ffi-efl-39eceb24663e22eeb8783d87dabbc62f21352194.tar.gz
extract-api.sh works with api-next folder
-rwxr-xr-xtools/extract-api.sh25
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
index 27a32bc..288f787 100755
--- a/tools/extract-api.sh
+++ b/tools/extract-api.sh
@@ -6,17 +6,22 @@ P=$(dirname $0)
#
CURRENT=$P/api
PREV=$P/api-prev
+NEXT=$P/api-next
INCLUDE=$(pkg-config --variable=includedir ecore)
#
-if [ ! -d $CURRENT ]; then
- mkdir $CURRENT
-elif [ "$SMASH" == "Yes" ]; then
- rm -fr $PREV *-diff 2>/dev/null
- mv $CURRENT $PREV && mkdir $CURRENT || exit 1
+[ ! -d $NEXT ] && mkdir $NEXT
+[ ! -d $PREV ] && mkdir $PREV
+[ ! -d $CURRENT ] && mkdir $CURRENT
+#
+rm *-diff 2>/dev/null
+#
+if [ "$SMASH" == "Yes" ]; then
+ rm -fr $PREV && cp -R $CURRENT $PREV || exit 1
else
+ PREV=$CURRENT
echo "no -x argument, won't override previous data"
+ echo "new api will be stored in $NEXT"
fi
-[ ! -d $PREV ] && mkdir $PREV
#
for header in \
"${INCLUDE}/eina-1/eina/eina_types.h" \
@@ -48,12 +53,16 @@ for header in \
#
for what in functions enums types callbacks variables; do
F=$FILE-$what
- cat $header | sed -r -n -f $P/sed-$what > $CURRENT/$F
+ cat $header | sed -r -n -f $P/sed-$what > $NEXT/$F
if [ -f $PREV/$F ]; then
- diff -u0 $PREV/$F $CURRENT/$F > $P/$F-diff
+ diff -u0 $PREV/$F $NEXT/$F > $P/$F-diff
N=$(cat $P/$F-diff | wc -l)
[ $N -eq 0 ] && rm $P/$F-diff || echo "see $P/$F-diff"
fi
done
#
done
+#
+if [ "$SMASH" == "Yes" ]; then
+ rm -fr $CURRENT && mv $NEXT $CURRENT || exit 1
+fi