From 58d59e463ca85ba279202956b3c269d2d353c9aa Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Fri, 20 Sep 2019 20:16:26 +0200 Subject: [PATCH] update_ts.sh: don't update ts files on pull w/o build directory --- scripts/update_ts.sh | 64 +++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/scripts/update_ts.sh b/scripts/update_ts.sh index 927f77acbd2..6657529825f 100755 --- a/scripts/update_ts.sh +++ b/scripts/update_ts.sh @@ -151,17 +151,18 @@ elif [ $action = pull ]; then fi fi -echo Updating python translations -( - cd python - mkdir -p tmp - pylupdate5 user.py utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts - perl ../scripts/ts2ui.pl python-i18n.ts tmp - rm python-i18n.ts -) -for i in python/plugins/*/CMakeLists.txt; do - cd ${i%/*} - cat <python-i18n.pro +if [ -d "$builddir" ]; then + echo Updating python translations + ( + cd python + mkdir -p tmp + pylupdate5 user.py utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts + perl ../scripts/ts2ui.pl python-i18n.ts tmp + rm python-i18n.ts + ) + for i in python/plugins/*/CMakeLists.txt; do + cd ${i%/*} + cat <python-i18n.pro SOURCES = $(find . -type f -name "*.py" -print | sed -e 's/^/ /' -e 's/$/ \\/') @@ -171,34 +172,35 @@ FORMS = $(find . -type f -name "*.ui" -print | sed -e 's/^/ /' -e 's/$/ \\/') TRANSLATIONS = python-i18n.ts EOF - pylupdate5 -tr-function trAlgorithm python-i18n.pro - mkdir -p tmp - perl ../../../scripts/ts2ui.pl python-i18n.ts tmp - rm python-i18n.ts python-i18n.pro - cd ../../.. -done + pylupdate5 -tr-function trAlgorithm python-i18n.pro + mkdir -p tmp + perl ../../../scripts/ts2ui.pl python-i18n.ts tmp + rm python-i18n.ts python-i18n.pro + cd ../../.. + done -echo Updating GRASS module translations -perl scripts/qgm2ui.pl >src/plugins/grass/grasslabels-i18n.ui + echo Updating GRASS module translations + perl scripts/qgm2ui.pl >src/plugins/grass/grasslabels-i18n.ui -echo Updating processing translations -mkdir -p python/plugins/processing/tmp -perl scripts/processing2ui.pl python/plugins/processing/tmp + echo Updating processing translations + mkdir -p python/plugins/processing/tmp + perl scripts/processing2ui.pl python/plugins/processing/tmp -echo Updating appinfo files -python3 scripts/appinfo2ui.py >src/app/appinfo-i18n.ui + echo Updating appinfo files + python3 scripts/appinfo2ui.py >src/app/appinfo-i18n.ui -echo Creating qmake project file -$QMAKE -project -o qgis_ts.pro -nopwd $SRCDIR/src $SRCDIR/python $SRCDIR/i18n $textcpp + echo Creating qmake project file + $QMAKE -project -o qgis_ts.pro -nopwd $SRCDIR/src $SRCDIR/python $SRCDIR/i18n $textcpp -QT_INSTALL_HEADERS=$(qmake -query QT_INSTALL_HEADERS) + QT_INSTALL_HEADERS=$(qmake -query QT_INSTALL_HEADERS) -echo "TR_EXCLUDE = ${QT_INSTALL_HEADERS% }/*" >>qgis_ts.pro + echo "TR_EXCLUDE = ${QT_INSTALL_HEADERS% }/*" >>qgis_ts.pro -echo Updating translations -$LUPDATE -no-ui-lines -no-obsolete -locations absolute -verbose qgis_ts.pro + echo Updating translations + $LUPDATE -no-ui-lines -no-obsolete -locations absolute -verbose qgis_ts.pro -perl -i.bak -ne 'print unless /^\s+