2013-12-21 15:38:52 -08:00
|
|
|
#!/bin/bash
|
|
|
|
# Installation: ln -s ../../precommit-hook.sh .git/hooks/pre-commit
|
|
|
|
|
2015-09-27 07:28:26 -07:00
|
|
|
for directory in patches debian; do
|
|
|
|
if [ ! -z "$(git status --porcelain "$directory")" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "*** PLEASE ADD OR STASH YOUR CHANGES IN $directory ***"
|
|
|
|
echo ""
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2013-12-21 15:38:52 -08:00
|
|
|
git diff --cached --name-status | while read status file; do
|
2014-07-12 16:32:09 -07:00
|
|
|
if [[ "$file" =~ ^patches/ ]] || [[ "$file" =~ ^debian/tools/ ]] || [[ "$file" =~ ^debian/changelog ]]; then
|
2013-12-21 15:38:52 -08:00
|
|
|
echo ""
|
2014-07-11 09:51:03 -07:00
|
|
|
echo "*** UPDATING AUTOGENERATED FILES ***"
|
2013-12-21 15:38:52 -08:00
|
|
|
echo ""
|
2014-07-11 10:34:33 -07:00
|
|
|
debian/tools/patchupdate.py || exit 1
|
2013-12-21 15:38:52 -08:00
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|