script to find new perms from permacrud that are not in the permission seed data yet
[Evergreen.git] / Open-ILS / src / extras / reconcile-perms.sh
1 #!/bin/bash
2 pushd . >/dev/null 2>/dev/null
3 cd `dirname $0`
4
5 xsltproc ../../examples/extract-IDL-permissions.xsl ../../examples/fm_IDL.xml|perl -e 'while(<>){s/^\s+(.*)\s+$/$1/o;print("$1\n")unless(/^\s*$/ || /\s+/)}'|sort -u > /tmp/oils_permacrud_perm_list
6 grep -A1 perm_list ../sql/Pg/950.data.seed-values.sql|grep "'"|cut -f2 -d"'"|sort -u > /tmp/oils_sql_perm_list
7
8 echo "New permissions from permacrud:"
9 echo
10
11 diff -pu /tmp/oils_sql_perm_list /tmp/oils_permacrud_perm_list |grep '^+'|cut -f2 -d'+'|grep -v '^$'
12
13 echo
14
15 popd >/dev/null 2>/dev/null
16
17