Skip to content
Permalink
Browse files

fix prepare-commit for python additions

  • Loading branch information
3nids committed Jun 20, 2018
1 parent f749c52 commit 408979ceb5744aa1eebe3a6c812dd3df842a7509
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/prepare-commit.sh
@@ -116,15 +116,15 @@ for f in $MODIFIED; do
# if cpp header
if [[ $f =~ ^src\/(core|gui|analysis|server)\/.*\.h$ ]]; then
# look if corresponding SIP file
sip_include=$(${GP}sed -r 's@^src/(\w+)/.*$@python/\1/\1.sip@' <<< $f )
sip_file=$(${GP}sed -r 's@^src/(core|gui|analysis|server)/@@; s@\.h$@.sip@' <<<$f )
pyfile=$(${GP}sed -E 's@([^\/]+\/)*([^\/]+)\.sip@\2.py@;' <<< $sip_file)
module=$(${GP}sed -r 's@src/(core|gui|analysis|server)/.*$@\1@' <<<$f )
if grep -Fq "$sip_file" ${TOPLEVEL}/python/${module}/${module}_auto.sip; then
sip_file=$(${GP}sed -r 's@^src/(core|gui|analysis|server)@\1/auto_generated@; s@\.h$@.sip.in@' <<<$f )
m=python/$sip_file.$REV.prepare
touch python/$sip_file
cp python/$sip_file $m
${TOPLEVEL}/scripts/sipify.pl -s python/$sip_file -p python/${module}/__init__.py $f
${TOPLEVEL}/scripts/sipify.pl -s python/$sip_file -p python/${module}/auto_additions/${pyfile} $f
if ! diff -u $m python/$sip_file >>$SIPIFYDIFF; then
echo "python/$sip_file is not up to date"
fi

0 comments on commit 408979c

Please sign in to comment.
You can’t perform that action at this time.