diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-04-16 18:13:32 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-04-16 18:13:32 +0200 |
commit | 56af88aeceb10b0c66f4a26227e8980654c6c587 (patch) | |
tree | 3187b9d44ef9aac1cc23e3d0608ced696e91c430 /tools | |
parent | bf681e9e90adf99357f754284703ea2c6dc3ff4e (diff) | |
download | ffi-efl-56af88aeceb10b0c66f4a26227e8980654c6c587.zip ffi-efl-56af88aeceb10b0c66f4a26227e8980654c6c587.tar.gz |
add gitignore, extract api into ./tools/api
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/extract-api.sh | 26 | ||||
-rw-r--r-- | tools/sed-functions | 6 |
2 files changed, 18 insertions, 14 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 diff --git a/tools/sed-functions b/tools/sed-functions index bcd57d0..9438459 100644 --- a/tools/sed-functions +++ b/tools/sed-functions @@ -1,8 +1,8 @@ # if return type on single line, append next line -/EAPI.*[^;] *$/ { N; s/\n/ / } +/EAPI.*[^;]\s*$/ { N; s/\n/ / } # while unfinished argument list, append next line :loop /,$/ { N; s/\n/ /; t loop } -s/ \{2,\}/ /g -s/^ *EAPI/EAPI/p +s/ {2,}/ /g +s/^\s*EAPI/EAPI/p |