Author: rgheck
Date: Tue Jan 18 16:41:16 2011
New Revision: 37252
URL: http://www.lyx.org/trac/changeset/37252
Log:
Script for automatic updating of ui and bind files.
Added:
lyx-devel/trunk/development/tools/updatelfuns.sh
Added: lyx-devel/trunk/development/tools/updatelfuns.sh
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ lyx-devel/trunk/development/tools/updatelfuns.sh Tue Jan 18 16:41:16
2011 (r37252)
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+function do_convert {
+ for i in *; do
+ if [ ! -f $i ]; then continue; fi
+ cp $i $i.old;
+ python $lyxdir/lib/scripts/prefs2prefs.py -l <$i.old >$i;
+ done
+}
+
+# find out where we are relative to the program directory
+curdir=$(pwd);
+progloc=$0;
+pathto=${progloc%/*};
+# get us into development/tools
+if [ "$progloc" != "$pathto" ]; then
+ if ! cd $pathto; then
+ echo "Couldn't get to development/tools!";
+ exit 1;
+ fi
+fi
+
+curdir=`pwd`;
+lyxdir=${curdir%/development/tools*};
+
+if ! cd $lyxdir/lib/ui/; then
+ echo "Couldn't get to lib/ui!";
+ exit 1;
+fi
+
+do_convert;
+
+if ! cd $lyxdir/lib/bind/; then
+ echo "Couldn't get to lib/bind!";
+ exit 1;
+fi
+
+do_convert;
+
+#now do the subdirectories
+for d in *; do
+ if [ ! -d $d ]; then continue; fi
+ cd $d;
+ do_convert;
+ cd ..;
+done