Redesign lupdate.sh script. Speed up pull time up to 4 times.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-12-13 14:44:10 +02:00
parent 5baa002c00
commit 8dc00022f4

View File

@ -1,10 +1,28 @@
#!/bin/sh
#!/bin/bash
# Run this script if you want to find and update all strings in the code.
# lupdate doesn't work with recursive *.pro file and without direct pointing to correct *.pro file just update exists strings in code.
# Please, run this script from folder <root_folder>/scripts.
start=$(date +%s)
# Download all translations from transifex.com.
tx pull --mode=developer -f -s --skip
cd ../share/translations
RESOURCES=`find . -regextype sed -regex ".*/measurements_p[0-9]\{1,2\}\.ts"`
cd ../../scripts
NUMBER=( $RESOURCES )
NUMBER=${#NUMBER[@]}
for ((i=0;i<NUMBER;i++)); do
tx pull -r valentina-project.measurements_p${i}ts --mode=developer -f --skip &
sleep 6
done
tx pull -r valentina-project.valentina_ts --mode=developer -f --skip &
sleep 6
tx pull -r valentina-project.measurements_p998ts --mode=developer -f --skip &
wait
# Update local strings
lupdate -recursive ../share/translations/translations.pro
@ -19,6 +37,8 @@ do
rm -f -v $var
done
echo Done.
end=$(date +%s)
runtime=$(python -c "print 'Time passed %u:%02u seconds' % ((${end} - ${start})/60, (${end} - ${start})%60)")
echo $runtime
echo For updating files run: build all.