QGIS/scripts/sipify_all.sh

49 lines
1.7 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
###########################################################################
# 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. #
# #
###########################################################################
set -e
DIR=$(git rev-parse --show-toplevel)
# GNU prefix command for mac os support (gsed, gsplit)
GP=
if [[ "$OSTYPE" =~ darwin* ]]; then
GP=g
fi
pushd ${DIR} > /dev/null
2017-04-24 15:52:13 +02:00
count=0
2017-06-26 09:57:09 +02:00
modules=(core gui analysis server)
for module in "${modules[@]}"; do
while read -r sipfile; do
echo "$sipfile"
header=$(${GP}sed -E 's/(.*)\.sip/src\/\1.h/' <<< $sipfile)
2017-06-26 09:57:09 +02:00
if [ ! -f $header ]; then
echo "*** Missing header: $header for sipfile $sipfile"
else
path=$(${GP}sed -r 's@/[^/]+$@@' <<< $sipfile)
2017-06-26 09:57:09 +02:00
mkdir -p python/$path
./scripts/sipify.pl $header > python/$sipfile
fi
count=$((count+1))
done < <( ${GP}sed -n -r "s/^%Include (.*\.sip)/${module}\/\1/p" python/${module}/${module}_auto.sip )
done
2017-04-30 14:12:05 +02:00
echo " => $count files sipified! 🍺"
2017-04-24 15:52:13 +02:00
popd > /dev/null