From 93045c2a8d1cbb5e6fb70746fc104e19e1b7f972 Mon Sep 17 00:00:00 2001 From: walking Date: Sat, 12 Feb 2011 11:30:21 +0000 Subject: [PATCH] make windoz msg bundling suck less --- apps/desktopgui/build.xml | 12 +++------ apps/desktopgui/bundle-messages.sh | 17 ++++++++++++- apps/i2psnark/java/bmsg.sh | 17 ------------- apps/i2psnark/java/build.xml | 14 +++++------ apps/i2psnark/java/bundle-messages.bat | 28 --------------------- apps/i2psnark/java/bundle-messages.sh | 16 ++++++++++++ apps/i2ptunnel/java/bmsg.sh | 17 ------------- apps/i2ptunnel/java/build.xml | 14 +++++------ apps/i2ptunnel/java/bundle-messages.bat | 28 --------------------- apps/i2ptunnel/java/bundle-messages.sh | 16 ++++++++++++ apps/routerconsole/java/bmsg.sh | 17 ------------- apps/routerconsole/java/build.xml | 6 ++--- apps/routerconsole/java/bundle-messages.bat | 28 --------------------- apps/susidns/src/bmsg.sh | 17 ------------- apps/susidns/src/build.xml | 14 +++++------ apps/susidns/src/bundle-messages.bat | 28 --------------------- apps/susidns/src/bundle-messages.sh | 16 ++++++++++++ 17 files changed, 89 insertions(+), 216 deletions(-) delete mode 100644 apps/i2psnark/java/bmsg.sh delete mode 100644 apps/i2psnark/java/bundle-messages.bat delete mode 100644 apps/i2ptunnel/java/bmsg.sh delete mode 100644 apps/i2ptunnel/java/bundle-messages.bat delete mode 100644 apps/routerconsole/java/bmsg.sh delete mode 100644 apps/routerconsole/java/bundle-messages.bat delete mode 100644 apps/susidns/src/bmsg.sh delete mode 100644 apps/susidns/src/bundle-messages.bat diff --git a/apps/desktopgui/build.xml b/apps/desktopgui/build.xml index e4af843935..f5de9ff4f2 100644 --- a/apps/desktopgui/build.xml +++ b/apps/desktopgui/build.xml @@ -45,10 +45,8 @@ - - - - + + @@ -82,10 +80,8 @@ - - - - + + diff --git a/apps/desktopgui/bundle-messages.sh b/apps/desktopgui/bundle-messages.sh index 4762e9a8bf..acd52a3533 100644 --- a/apps/desktopgui/bundle-messages.sh +++ b/apps/desktopgui/bundle-messages.sh @@ -19,6 +19,17 @@ then POUPDATE=1 fi +# on windows, one must specify the path of commnad find +# since windows has its own retarded version of find. +if which find|grep -q -i windows ; then + export PATH=.:/bin:/usr/local/bin:$PATH +fi +# Fast mode - update ondemond +echo Placing a file named messages_{LangCode}.only in locale folder, +echo will limit .po file update to the language specified by {LangCode}. +LG2=$(find locale -iname messages_*.only|tail -1) +[ LG2 ] && LG2=${LG2#locale/messages_} && LG2=${LG2%.only} + # add ../java/ so the refs will work in the po file JPATHS="src" for i in locale/messages_*.po @@ -26,6 +37,11 @@ do # get language LG=${i#locale/messages_} LG=${LG%.po} + + # skip, if specified + if [ $LG2 ]; then + [ $LG != $LG2 ] && continue || echo INFO: Language update is set to [$LG2] only. + fi if [ "$POUPDATE" = "1" ] then @@ -33,7 +49,6 @@ do find $JPATHS -name *.java -newer $i > $TMPFILE fi - echo $LG if [ -s build/net/i2p/desktopgui/messages_$LG.class -a \ build/net/i2p/desktopgui/messages_$LG.class -nt $i -a \ ! -s $TMPFILE ] diff --git a/apps/i2psnark/java/bmsg.sh b/apps/i2psnark/java/bmsg.sh deleted file mode 100644 index b9d294b323..0000000000 --- a/apps/i2psnark/java/bmsg.sh +++ /dev/null @@ -1,17 +0,0 @@ -# -# Update messages_xx.po and messages_xx.class files, -# from both java and jsp sources. -# Requires installed programs xgettext, msgfmt, msgmerge, and find. -# zzz - public domain -# - -## launching sh.exe with -login parameter will open a shell with the current path always pointing to \bin\ -## need to cd into our orignal path - where we call sh.exe from. - -cd $CALLFROM -## echo $PWD - -## except this everything is the same with bundle-message.sh -## walking - public domain :-D - -source bundle-messages.sh $PARAS \ No newline at end of file diff --git a/apps/i2psnark/java/build.xml b/apps/i2psnark/java/build.xml index 90f5cd6fe8..2fbc2f507b 100644 --- a/apps/i2psnark/java/build.xml +++ b/apps/i2psnark/java/build.xml @@ -59,15 +59,14 @@ - + - + - - - + + @@ -81,9 +80,8 @@ - - - + + diff --git a/apps/i2psnark/java/bundle-messages.bat b/apps/i2psnark/java/bundle-messages.bat deleted file mode 100644 index cb72cc5d1d..0000000000 --- a/apps/i2psnark/java/bundle-messages.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -set Callfrom=%cd% -set Paras=%1 - -rem before calling make sure you have msys and mingw 's "bin" path -rem in your current searching path -rem type "set path" to check -if not exist ..\locale\*.only goto updateALL - -rem put a messages_xx.only(eg messages_zh.only) into locale folder -rem this script will only touch the po file(eg zh) you specified, leaving other po files untact. -echo [tip] Puting a messages_{LangCode}.only (eg messages_zh.only) -echo into locale folder will restrict the PO file update -echo process to your choosen language ONLY. -for %%i in (..\locale\*.only) do set PO=%%~ni -echo [info] %PO%.only found, will ONLY update file : %PO%.po -for %%i in (..\locale\*.po) do if not %%~ni==%PO% ren %%i %%~ni.po- - -call sh --login %cd%\bmsg.sh - -for %%i in (..\locale\*.po-) do if not %%~ni==%PO% ren %%i %%~ni.po -goto end - -:updateALL -call sh --login %cd%\bmsg.sh - -:end -echo End of Message Bundling \ No newline at end of file diff --git a/apps/i2psnark/java/bundle-messages.sh b/apps/i2psnark/java/bundle-messages.sh index c09aa811f9..d5d116ac31 100755 --- a/apps/i2psnark/java/bundle-messages.sh +++ b/apps/i2psnark/java/bundle-messages.sh @@ -18,6 +18,17 @@ then POUPDATE=1 fi +# on windows, one must specify the path of commnad find +# since windows has its own retarded version of find. +if which find|grep -q -i windows ; then + export PATH=.:/bin:/usr/local/bin:$PATH +fi +# Fast mode - update ondemond +echo Placing a file named messages_{LangCode}.only in locale folder, +echo will limit .po file update to the language specified by {LangCode}. +LG2=$(find ../locale -iname messages_*.only|tail -1) +[ LG2 ] && LG2=${LG2#../locale/messages_} && LG2=${LG2%.only} + # add ../java/ so the refs will work in the po file JPATHS="../java/src" for i in ../locale/messages_*.po @@ -26,6 +37,11 @@ do LG=${i#../locale/messages_} LG=${LG%.po} + # skip, if specified + if [ $LG2 ]; then + [ $LG != $LG2 ] && continue || echo INFO: Language update is set to [$LG2] only. + fi + if [ "$POUPDATE" = "1" ] then # make list of java files newer than the .po file diff --git a/apps/i2ptunnel/java/bmsg.sh b/apps/i2ptunnel/java/bmsg.sh deleted file mode 100644 index b9d294b323..0000000000 --- a/apps/i2ptunnel/java/bmsg.sh +++ /dev/null @@ -1,17 +0,0 @@ -# -# Update messages_xx.po and messages_xx.class files, -# from both java and jsp sources. -# Requires installed programs xgettext, msgfmt, msgmerge, and find. -# zzz - public domain -# - -## launching sh.exe with -login parameter will open a shell with the current path always pointing to \bin\ -## need to cd into our orignal path - where we call sh.exe from. - -cd $CALLFROM -## echo $PWD - -## except this everything is the same with bundle-message.sh -## walking - public domain :-D - -source bundle-messages.sh $PARAS \ No newline at end of file diff --git a/apps/i2ptunnel/java/build.xml b/apps/i2ptunnel/java/build.xml index 163de66968..6ff5111002 100644 --- a/apps/i2ptunnel/java/build.xml +++ b/apps/i2ptunnel/java/build.xml @@ -48,15 +48,14 @@ - + - + - - - + + @@ -70,9 +69,8 @@ - - - + + diff --git a/apps/i2ptunnel/java/bundle-messages.bat b/apps/i2ptunnel/java/bundle-messages.bat deleted file mode 100644 index 20b42773ba..0000000000 --- a/apps/i2ptunnel/java/bundle-messages.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -set Callfrom=%cd% -set Paras=%1 - -rem before calling make sure you have msys and mingw 's "bin" path -rem in your current searching path -rem type "set path" to check -if not exist ..\locale\*.only goto updateALL - -rem put a messages_xx.only(eg messages_zh.only) into locale folder -rem this script will only touch the po file(eg zh) you specified, leaving other po files untact. -echo [tip] Puting a messages_{LangCode}.only (eg messages_zh.only) -echo into locale folder will restrict the PO file update -echo process to your choosen language ONLY. -for %%i in (..\locale\*.only) do set PO=%%~ni -echo [info] %PO%.po found, will ONLY update file : %PO%.po -for %%i in (..\locale\*.po) do if not %%~ni==%PO% ren %%i %%~ni.po- - -call sh --login %cd%\bmsg.sh - -for %%i in (..\locale\*.po-) do if not %%~ni==%PO% ren %%i %%~ni.po -goto end - -:updateALL -call sh --login %cd%\bmsg.sh - -:end -echo End of Message Bundling \ No newline at end of file diff --git a/apps/i2ptunnel/java/bundle-messages.sh b/apps/i2ptunnel/java/bundle-messages.sh index 236b0ad011..6b3f09dbd6 100755 --- a/apps/i2ptunnel/java/bundle-messages.sh +++ b/apps/i2ptunnel/java/bundle-messages.sh @@ -18,6 +18,17 @@ then POUPDATE=1 fi +# on windows, one must specify the path of commnad find +# since windows has its own retarded version of find. +if which find|grep -q -i windows ; then + export PATH=.:/bin:/usr/local/bin:$PATH +fi +# Fast mode - update ondemond +echo Placing a file named messages_{LangCode}.only in locale folder, +echo will limit .po file update to the language specified by {LangCode}. +LG2=$(find ../locale -iname messages_*.only|tail -1) +[ LG2 ] && LG2=${LG2#../locale/messages_} && LG2=${LG2%.only} + # add ../java/ so the refs will work in the po file JPATHS="../java/src ../jsp/WEB-INF" for i in ../locale/messages_*.po @@ -26,6 +37,11 @@ do LG=${i#../locale/messages_} LG=${LG%.po} + # skip, if specified + if [ $LG2 ]; then + [ $LG != $LG2 ] && continue || echo INFO: Language update is set to [$LG2] only. + fi + if [ "$POUPDATE" = "1" ] then # make list of java files newer than the .po file diff --git a/apps/routerconsole/java/bmsg.sh b/apps/routerconsole/java/bmsg.sh deleted file mode 100644 index b9d294b323..0000000000 --- a/apps/routerconsole/java/bmsg.sh +++ /dev/null @@ -1,17 +0,0 @@ -# -# Update messages_xx.po and messages_xx.class files, -# from both java and jsp sources. -# Requires installed programs xgettext, msgfmt, msgmerge, and find. -# zzz - public domain -# - -## launching sh.exe with -login parameter will open a shell with the current path always pointing to \bin\ -## need to cd into our orignal path - where we call sh.exe from. - -cd $CALLFROM -## echo $PWD - -## except this everything is the same with bundle-message.sh -## walking - public domain :-D - -source bundle-messages.sh $PARAS \ No newline at end of file diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml index fdb976fbec..4135215867 100644 --- a/apps/routerconsole/java/build.xml +++ b/apps/routerconsole/java/build.xml @@ -80,13 +80,13 @@ - + - + - + diff --git a/apps/routerconsole/java/bundle-messages.bat b/apps/routerconsole/java/bundle-messages.bat deleted file mode 100644 index cb72cc5d1d..0000000000 --- a/apps/routerconsole/java/bundle-messages.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -set Callfrom=%cd% -set Paras=%1 - -rem before calling make sure you have msys and mingw 's "bin" path -rem in your current searching path -rem type "set path" to check -if not exist ..\locale\*.only goto updateALL - -rem put a messages_xx.only(eg messages_zh.only) into locale folder -rem this script will only touch the po file(eg zh) you specified, leaving other po files untact. -echo [tip] Puting a messages_{LangCode}.only (eg messages_zh.only) -echo into locale folder will restrict the PO file update -echo process to your choosen language ONLY. -for %%i in (..\locale\*.only) do set PO=%%~ni -echo [info] %PO%.only found, will ONLY update file : %PO%.po -for %%i in (..\locale\*.po) do if not %%~ni==%PO% ren %%i %%~ni.po- - -call sh --login %cd%\bmsg.sh - -for %%i in (..\locale\*.po-) do if not %%~ni==%PO% ren %%i %%~ni.po -goto end - -:updateALL -call sh --login %cd%\bmsg.sh - -:end -echo End of Message Bundling \ No newline at end of file diff --git a/apps/susidns/src/bmsg.sh b/apps/susidns/src/bmsg.sh deleted file mode 100644 index b9d294b323..0000000000 --- a/apps/susidns/src/bmsg.sh +++ /dev/null @@ -1,17 +0,0 @@ -# -# Update messages_xx.po and messages_xx.class files, -# from both java and jsp sources. -# Requires installed programs xgettext, msgfmt, msgmerge, and find. -# zzz - public domain -# - -## launching sh.exe with -login parameter will open a shell with the current path always pointing to \bin\ -## need to cd into our orignal path - where we call sh.exe from. - -cd $CALLFROM -## echo $PWD - -## except this everything is the same with bundle-message.sh -## walking - public domain :-D - -source bundle-messages.sh $PARAS \ No newline at end of file diff --git a/apps/susidns/src/build.xml b/apps/susidns/src/build.xml index 8244d37cfb..ad20ad49a3 100644 --- a/apps/susidns/src/build.xml +++ b/apps/susidns/src/build.xml @@ -80,15 +80,14 @@ - + - + - - - + + @@ -102,9 +101,8 @@ - - - + + diff --git a/apps/susidns/src/bundle-messages.bat b/apps/susidns/src/bundle-messages.bat deleted file mode 100644 index cb72cc5d1d..0000000000 --- a/apps/susidns/src/bundle-messages.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -set Callfrom=%cd% -set Paras=%1 - -rem before calling make sure you have msys and mingw 's "bin" path -rem in your current searching path -rem type "set path" to check -if not exist ..\locale\*.only goto updateALL - -rem put a messages_xx.only(eg messages_zh.only) into locale folder -rem this script will only touch the po file(eg zh) you specified, leaving other po files untact. -echo [tip] Puting a messages_{LangCode}.only (eg messages_zh.only) -echo into locale folder will restrict the PO file update -echo process to your choosen language ONLY. -for %%i in (..\locale\*.only) do set PO=%%~ni -echo [info] %PO%.only found, will ONLY update file : %PO%.po -for %%i in (..\locale\*.po) do if not %%~ni==%PO% ren %%i %%~ni.po- - -call sh --login %cd%\bmsg.sh - -for %%i in (..\locale\*.po-) do if not %%~ni==%PO% ren %%i %%~ni.po -goto end - -:updateALL -call sh --login %cd%\bmsg.sh - -:end -echo End of Message Bundling \ No newline at end of file diff --git a/apps/susidns/src/bundle-messages.sh b/apps/susidns/src/bundle-messages.sh index b1cd377b3f..3d0aa9d379 100755 --- a/apps/susidns/src/bundle-messages.sh +++ b/apps/susidns/src/bundle-messages.sh @@ -18,6 +18,17 @@ then POUPDATE=1 fi +# on windows, one must specify the path of commnad find +# since windows has its own retarded version of find. +if which find|grep -q -i windows ; then + export PATH=.:/bin:/usr/local/bin:$PATH +fi +# Fast mode - update ondemond +echo Placing a file named messages_{LangCode}.only in locale folder, +echo will limit .po file update to the language specified by {LangCode}. +LG2=$(find ../locale -iname messages_*.only|tail -1) +[ LG2 ] && LG2=${LG2#../locale/messages_} && LG2=${LG2%.only} + # add ../src/ so the refs will work in the po file JPATHS="../src/java/ ../src/tmp/" for i in ../locale/messages_*.po @@ -26,6 +37,11 @@ do LG=${i#../locale/messages_} LG=${LG%.po} + # skip, if specified + if [ $LG2 ]; then + [ $LG != $LG2 ] && continue || echo INFO: Language update is set to [$LG2] only. + fi + if [ "$POUPDATE" = "1" ] then # make list of java files newer than the .po file