From 39eceb24663e22eeb8783d87dabbc62f21352194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 19 Jun 2011 18:42:15 +0200 Subject: extract-api.sh works with api-next folder --- tools/extract-api.sh | 25 +++++++++++++++++-------- 1 file 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 -- cgit v1.1-2-g2b99