summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-21 07:32:59 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-21 07:32:59 +0200
commita84f1bbae4dd2053f19dc8c82cc54bd5e57553f3 (patch)
tree92713787fdef79102254b6eaa21afe2679b602b1 /tools
parent7246ce62120e6069626b711eb9340a38d6a3b63b (diff)
downloadffi-efl-a84f1bbae4dd2053f19dc8c82cc54bd5e57553f3.zip
ffi-efl-a84f1bbae4dd2053f19dc8c82cc54bd5e57553f3.tar.gz
extract-api.sh, don't override previous data without -x flag
Diffstat (limited to 'tools')
-rwxr-xr-xtools/extract-api.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
index 6ec77ca..2fecec0 100755
--- a/tools/extract-api.sh
+++ b/tools/extract-api.sh
@@ -2,13 +2,21 @@
#
P=$(dirname $0)
#
+[ $# -gt 0 -a "$1" == "-x" ] && SMASH="Yes"
+#
CURRENT=$P/api
PREV=$P/api-prev
INCLUDE=$(pkg-config --libs ecore |gawk '{ print substr($1,3) }' | sed s/lib/include/)
#
+if [ ! -d $CURRENT ]; then
+ mkdir $CURRENT
+elif [ "$SMASH" == "Yes" ]; then
+ rm -fr $PREV *-diff 2>/dev/null
+ mv $CURRENT $PREV && mkdir $CURRENT || exit 1
+else
+ echo "no -x argument, won't override previous data"
+fi
[ ! -d $PREV ] && mkdir $PREV
-[ ! -d $CURRENT ] && mkdir $CURRENT
-rm *-diff 2>/dev/null
#
for header in \
"${INCLUDE}/eina-1/eina/eina_types.h" \
@@ -29,8 +37,6 @@ for header in \
DIR=$(dirname $header)
FILE=$(basename $header)
#
- mv $CURRENT/$FILE-* $PREV/ 2>/dev/null
- #
for what in functions enums types callbacks; do
F=$FILE-$what
cat $header | sed -r -n -f $P/sed-$what > $CURRENT/$F