registry/check-pol

19 lines
453 B
Plaintext
Raw Normal View History

2017-11-17 23:31:18 +01:00
#!/bin/bash
2017-11-12 16:15:57 +01:00
set -eo pipefail
2017-11-08 19:05:00 +01:00
if [ $# -eq 0 ]
then
echo "Usage: $0 COMMIT YOUR-MNT"
exit
fi
2017-12-31 20:03:56 +01:00
BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")"
2017-11-08 19:05:00 +01:00
BASE="$(dirname "$BASE")"
cd "$BASE" || exit 1
git diff --name-only $1 | while IFS='/' read -ra LINE; do
if [[ "${LINE[0]}" = "data" && -n "${LINE[2]}" ]]; then
2017-12-12 01:33:55 +01:00
utils/schema-check/dn42-schema.py -v policy ${LINE[1]} ${LINE[2]} $2
2017-11-08 19:05:00 +01:00
fi
done