]> git.lyx.org Git - lyx.git/blob - development/tools/updatelfuns.sh
Update LFUNs.lyx to current format
[lyx.git] / development / tools / updatelfuns.sh
1 #!/bin/bash
2
3 function do_convert {
4         for i in *; do 
5                 if [ ! -f $i ]; then continue; fi
6                 cp $i $i.old; 
7                 python $lyxdir/lib/scripts/prefs2prefs.py -l <$i.old >$i; 
8         done
9 }
10
11 # find out where we are relative to the program directory
12 curdir=$(pwd);
13 progloc=$0;
14 pathto=${progloc%/*};
15 # get us into development/tools
16 if [ "$progloc" != "$pathto" ]; then
17         if ! cd $pathto; then
18         echo "Couldn't get to development/tools!";
19         exit 1;
20         fi
21 fi
22
23 curdir=`pwd`;
24 lyxdir=${curdir%/development/tools*};
25
26 if ! cd $lyxdir/lib/ui/; then
27         echo "Couldn't get to lib/ui!";
28         exit 1;
29 fi
30
31 do_convert;
32
33 if ! cd $lyxdir/lib/bind/; then
34         echo "Couldn't get to lib/bind!";
35         exit 1;
36 fi
37
38 do_convert;
39
40 #now do the subdirectories
41 for d in *; do 
42         if [ ! -d $d ]; then continue; fi
43         cd $d;
44         do_convert;
45         cd ..;
46 done