Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-07-31 01:31:17 +0400
committermattab <matthieu.aubry@gmail.com>2013-07-31 01:31:17 +0400
commitc35e613b7ff66c6c86a712f0fd3250692ed9d8a9 (patch)
tree4e56d45743fc85f80014518e5c5bd419cc4a8f7b /misc
parent765be0dc8f92a6d4bb3e678a0c23f2d4b95e0e18 (diff)
parent13f657ccfa6b58864291a173a0849d7169b031b2 (diff)
Merge branch 'master' into php-5.3-namespaces
Conflicts: core/Access.php core/Config.php core/EventDispatcher.php core/JqplotDataGenerator/Evolution.php core/Piwik.php core/Plugin/MetadataLoader.php core/ViewDataTable.php core/ViewDataTable/Cloud.php core/ViewDataTable/GenerateGraphHTML.php core/ViewDataTable/HtmlTable.php core/ViewDataTable/HtmlTable/AllColumns.php core/ViewDataTable/HtmlTable/Goals.php plugins/Actions/Controller.php plugins/CoreHome/Controller.php plugins/CoreHome/DataTableRowAction/RowEvolution.php plugins/CoreHome/templates/_dataTable.twig plugins/CustomVariables/Controller.php plugins/DBStats/Controller.php plugins/DevicesDetection/Controller.php plugins/ExampleUI/Controller.php plugins/Goals/Controller.php plugins/Live/Controller.php plugins/Provider/Controller.php plugins/Referers/Controller.php plugins/UserCountry/Controller.php plugins/UserCountryMap/Controller.php plugins/UserSettings/Archiver.php plugins/UserSettings/Controller.php plugins/VisitTime/Controller.php plugins/VisitTime/VisitTime.php plugins/VisitorInterest/Controller.php plugins/VisitsSummary/Controller.php tests/PHPUnit/proxy/index.php
Diffstat (limited to 'misc')
-rw-r--r--misc/updateLanguageFiles.sh133
1 files changed, 77 insertions, 56 deletions
diff --git a/misc/updateLanguageFiles.sh b/misc/updateLanguageFiles.sh
index 2ad201446e..c824d0b02d 100644
--- a/misc/updateLanguageFiles.sh
+++ b/misc/updateLanguageFiles.sh
@@ -1,6 +1,12 @@
#!/bin/bash
PIWIKPATH=$PWD/..
+ENABLEGIT=1;
+if [ "$1" == '--no-git' ]; then
+ ENABLEGIT=0;
+ echo "NO-GIT MODE: No git actions will be performed!!"
+fi
+
################################
# Configuration
#
@@ -13,20 +19,24 @@ OTranceUser="downloaduser"
# Perform initial git actions
#
# update master branch
-git checkout master > /dev/null 2>&1
-git pull > /dev/null 2>&1
+if [ $ENABLEGIT -eq 1 ]; then
-# check if branch exists local (assume its the correct one if so)
-git branch | grep $GitBranchName > /dev/null 2>&1
+ git checkout master > /dev/null 2>&1
+ git pull > /dev/null 2>&1
-if [ $? -eq 1 ]; then
- git checkout -b $GitBranchName origin/$GitBranchName > /dev/null 2>&1
-fi
+ # check if branch exists local (assume its the correct one if so)
+ git branch | grep $GitBranchName > /dev/null 2>&1
+
+ if [ $? -eq 1 ]; then
+ git checkout -b $GitBranchName origin/$GitBranchName > /dev/null 2>&1
+ fi
+
+ # switch to branch and merge with master
+ git checkout $GitBranchName > /dev/null 2>&1
+ git merge master > /dev/null 2>&1
+ git push origin $GitBranchName > /dev/null 2>&1
-# switch to branch and merge with master
-git checkout $GitBranchName > /dev/null 2>&1
-git merge master > /dev/null 2>&1
-git push origin $GitBranchName > /dev/null 2>&1
+fi
#
################################
@@ -114,16 +124,22 @@ mv *.php ../lang/
cd $PIWIKPATH
list=(`git ls-files --other --exclude-standard lang`)
-echo "Untracked language files detected:
- Please choose the files that should be added to git.
- Other files will be removed.";
+if [ $ENABLEGIT -eq 1 ]; then
+ echo "Untracked language files detected:
+ Please choose the files that should be added to git.
+ Other files will be removed.";
+else
+ echo "Untracked language files detected:
+ Please choose the files that should be kept.
+ Other files will be removed.";
+fi;
for file in ${list[@]}
do
while true; do
read -p "Add new file $file to git? " yn
case $yn in
- [Yy]* ) git add $file; break;;
+ [Yy]* ) if [ $ENABLEGIT -eq 1 ]; then git add $file; fi; break;;
[Nn]* ) rm $file; break;;
* ) echo "Please answer yes or no. ";;
esac
@@ -136,6 +152,7 @@ done
# Cleanup / Test new files
#
# run tests to cleanup files as long as tests are failing
+echo "" &> $PIWIKPATH/tmp/languagecleanup.txt
counter=0
while true; do
@@ -148,7 +165,7 @@ while true; do
# run tests to cleanup files
echo "Running unittests to cleanup language files. This may take some time..."
cd $PIWIKPATH/tests/PHPUnit
- phpunit --group LanguagesManager > /dev/null 2>&1
+ phpunit --group LanguagesManager >> $PIWIKPATH/tmp/languagecleanup.txt
# If all tests pass, break loop
if [ $? -eq 0 ]; then
@@ -172,50 +189,54 @@ done
# Perform finish git actions & create pull request
#
# commit files
-cd $PIWIKPATH
-git add lang/. > /dev/null 2>&1
-git commit -m "language update refs #3430"
-git push
+if [ $ENABLEGIT -eq 1 ]; then
-while true; do
- read -p "Please provide your github username (to create a pull request using Github API): " username
-
- returnCode=(`curl \
- -X POST \
- -k \
- --silent \
- --write-out %{http_code} \
- --stderr /dev/null \
- -o /dev/null \
- -u $username \
- --data "{\"title\":\"automatic translation update\",\"body\":\"autogenerated translation update out of $downloadfile\",\"head\":\"$GitBranchName\",\"base\":\"master\"}" \
- -H 'Accept: application/json' \
- https://api.github.com/repos/piwik/piwik/pulls`);
-
- if [ $returnCode -eq 401 ]; then
- echo "Pull request failed. Bad credentials... Please try again"
- continue;
- fi
+ cd $PIWIKPATH
+ git add lang/. > /dev/null 2>&1
+ git commit -m "language update refs #3430"
+ git push
- if [ $returnCode -eq 422 ]; then
- echo "Pull request failed. Unprocessable Entity. Maybe a pull request was already created before."
- break;
- fi
-
- if [ $returnCode -eq 201 ]; then
- echo "Pull request successfully created."
- break;
- fi
-
- if [ $returnCode -eq 200 ]; then
- echo "Pull request successfully created."
- break;
- fi
+ while true; do
+ read -p "Please provide your github username (to create a pull request using Github API): " username
+
+ returnCode=(`curl \
+ -X POST \
+ -k \
+ --silent \
+ --write-out %{http_code} \
+ --stderr /dev/null \
+ -o /dev/null \
+ -u $username \
+ --data "{\"title\":\"automatic translation update\",\"body\":\"autogenerated translation update out of $downloadfile\",\"head\":\"$GitBranchName\",\"base\":\"master\"}" \
+ -H 'Accept: application/json' \
+ https://api.github.com/repos/piwik/piwik/pulls`);
+
+ if [ $returnCode -eq 401 ]; then
+ echo "Pull request failed. Bad credentials... Please try again"
+ continue;
+ fi
+
+ if [ $returnCode -eq 422 ]; then
+ echo "Pull request failed. Unprocessable Entity. Maybe a pull request was already created before."
+ break;
+ fi
+
+ if [ $returnCode -eq 201 ]; then
+ echo "Pull request successfully created."
+ break;
+ fi
+
+ if [ $returnCode -eq 200 ]; then
+ echo "Pull request successfully created."
+ break;
+ fi
+
+ echo "Pull request failed."
- echo "Pull request failed."
+ done
-done;
+ git checkout master > /dev/null 2>&1
-git checkout master > /dev/null 2>&1
+fi
#
################################ \ No newline at end of file