Relocate and redefine usb_mode enum
[platform/core/appfw/vconf-internal-keys.git] / update_smacktest.sh
1 #!/bin/bash
2 #--------------------------------------------------------------------
3 #
4 # HOW TO USE
5 #
6 # update a smack rule by putting an input txt file
7 # 0. sudo apt-get install xmlstarlet
8 # 1. edit smackinput.txt
9 # 2. run update_smacktest.sh smackinput.txt
10 #
11 # example)
12 # ./update_smacktest.sh smackinput.txt
13 #
14 # check the result with 'git diff'
15 #--------------------------------------------------------------------
16 filelist=`ls ./data/*.xml`
17
18 for file in $filelist
19 do
20         while read line
21         do
22                 keyname=`echo $line | awk '{ print $1}'`
23                 rulename=`echo $line | awk '{ print $2}'`
24                 echo $keyname "----------->" $rulename
25
26                 echo "xmlstarlet edit --pf --update "/vconfkeylists/vconfkey[@name='$keyname']/@label" -v '$rulename' $file > $file.temp"
27                 xmlstarlet edit --pf --update "/vconfkeylists/vconfkey[@name='$keyname']/@label" -v $rulename $file > $file.temp
28                 mv $file.temp $file
29         done < $1
30 done
31
32
33