LP1054322 - libparent-perl not needed for Ubuntu Precise
[working/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 for i in `diff -pu /tmp/oils_sql_perm_list /tmp/oils_permacrud_perm_list |grep '^+'|cut -f2 -d'+'|grep -v '^$'`; do
12         echo "INSERT INTO permission.perm_list (code) VALUES ('$i');"
13 done
14
15 echo
16
17 popd >/dev/null 2>/dev/null
18