From a84f1bbae4dd2053f19dc8c82cc54bd5e57553f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 21 Apr 2011 07:32:59 +0200 Subject: extract-api.sh, don't override previous data without -x flag --- tools/extract-api.sh | 14 ++++++++++---- 1 file 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 -- cgit v1.1-2-g2b99