2017-03-27 09:27:12 +02:00
|
|
|
#!/usr/bin/env bash
|
2017-03-29 10:06:41 +02:00
|
|
|
###########################################################################
|
|
|
|
# sipify_all.sh
|
|
|
|
# ---------------------
|
|
|
|
# Date : 25.03.2017
|
|
|
|
# Copyright : (C) 2017 by Denis Rouzaud
|
|
|
|
# Email : denis.rouzaud@gmail.com
|
|
|
|
###########################################################################
|
|
|
|
# #
|
|
|
|
# This program is free software; you can redistribute it and/or modify #
|
|
|
|
# it under the terms of the GNU General Public License as published by #
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or #
|
|
|
|
# (at your option) any later version. #
|
|
|
|
# #
|
|
|
|
###########################################################################
|
2017-03-27 15:36:48 +02:00
|
|
|
set -e
|
2017-03-27 09:27:12 +02:00
|
|
|
|
|
|
|
DIR=$(git rev-parse --show-toplevel)
|
|
|
|
|
2017-03-27 15:36:48 +02:00
|
|
|
# GNU prefix command for mac os support (gsed, gsplit)
|
|
|
|
GP=
|
|
|
|
if [[ "$OSTYPE" =~ darwin* ]]; then
|
|
|
|
GP=g
|
|
|
|
fi
|
|
|
|
|
|
|
|
pushd ${DIR} > /dev/null
|
2017-03-27 09:27:12 +02:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
count=0
|
|
|
|
|
2017-03-29 10:06:41 +02:00
|
|
|
while read -r sipfile; do
|
|
|
|
if ! grep -Fxq "$sipfile" python/auto_sip.blacklist; then
|
|
|
|
echo "$sipfile"
|
|
|
|
header=$(sed -E 's/(.*)\.sip/src\/\1.h/' <<< $sipfile)
|
|
|
|
if [ ! -f $header ]; then
|
|
|
|
echo "*** Missing header: $header for sipfile $sipfile"
|
|
|
|
else
|
|
|
|
./scripts/sipify.pl $header > python/$sipfile
|
|
|
|
fi
|
2017-04-24 15:52:13 +02:00
|
|
|
count=$((count+1))
|
2017-03-29 10:06:41 +02:00
|
|
|
fi
|
|
|
|
done < <(
|
2017-04-01 10:57:51 +02:00
|
|
|
${GP}sed -n -r 's/^%Include (.*\.sip)/core\/\1/p' python/core/core.sip
|
|
|
|
${GP}sed -n -r 's/^%Include (.*\.sip)/gui\/\1/p' python/gui/gui.sip
|
|
|
|
${GP}sed -n -r 's/^%Include (.*\.sip)/analysis\/\1/p' python/analysis/analysis.sip
|
2017-04-30 11:17:13 +02:00
|
|
|
${GP}sed -n -r 's/^%Include (.*\.sip)/server\/\1/p' python/server/server.sip
|
2017-03-29 10:06:41 +02:00
|
|
|
)
|
2017-03-27 15:36:48 +02:00
|
|
|
|
2017-04-24 15:52:13 +02:00
|
|
|
echo " => $count files sipified!"
|
|
|
|
|
2017-03-27 15:36:48 +02:00
|
|
|
popd > /dev/null
|