[MediaWiki-commits] [Gerrit] translatewiki[master]: Update rest of the scripts

2018-01-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402341 )

Change subject: Update rest of the scripts
..


Update rest of the scripts

Change-Id: Ia36bbf19a0c634f9047a042339b390dbe033444c
---
M bin/checkmsg
M bin/clupdate-bzr-repo
M bin/clupdate-git-repo
M bin/clupdate-svn-repo
M bin/createmi
M bin/fuzzy
M bin/fuzzyr
7 files changed, 20 insertions(+), 22 deletions(-)

Approvals:
  jenkins-bot: Verified
  Nikerabbit: Looks good to me, approved



diff --git a/bin/checkmsg b/bin/checkmsg
index 6251489..588faa6 100755
--- a/bin/checkmsg
+++ b/bin/checkmsg
@@ -1,3 +1,7 @@
+#!/bin/bash
+set -o nounset -o pipefail -o errexit
+
 # check if a message is being used. May give some false positives.
 # use 'grep -v to clean up.
-grep -r $1 $PWD/* |egrep -v 
"(svn|[.]ser|[.]cdb|i18n[.]php|Messages[A-Z]|l10n_cache|messages-mediawiki-bw_)"
+grep -r "$1" "$PWD"/* |
+   grep -vE 
"(svn|[.]ser|[.]cdb|i18n[.]php|Messages[A-Z]|l10n_cache|messages-mediawiki-bw_)"
diff --git a/bin/clupdate-bzr-repo b/bin/clupdate-bzr-repo
index 3eb9f70..6df3f9c 100755
--- a/bin/clupdate-bzr-repo
+++ b/bin/clupdate-bzr-repo
@@ -1,6 +1,5 @@
 #!/bin/bash
-set -e
-set -u
+set -o nounset -o pipefail -o errexit
 
 URL=$1
 DIR=$2
@@ -12,5 +11,5 @@
bzr revert --quiet
bzr pull "$BRANCH" --quiet --overwrite
 else
-   bzr checkout ${URL}/${BRANCH} "$DIR"
+   bzr checkout "${URL}/${BRANCH}" "$DIR"
 fi
diff --git a/bin/clupdate-git-repo b/bin/clupdate-git-repo
index 018362b..e80be77 100755
--- a/bin/clupdate-git-repo
+++ b/bin/clupdate-git-repo
@@ -1,12 +1,7 @@
 #!/bin/bash
-set -e
-set -u
+set -o nounset -o pipefail -o errexit
 
-DIRSCRIPT="`dirname \"$0\"`"
-DIRSCRIPT="`( cd \"$DIRSCRIPT\" && pwd )`"
-
-ME=`basename "$0"`
-
+ME=$(basename "$0")
 URL=$1
 DIR=$2
 BRANCH=${3:-master}
@@ -14,7 +9,7 @@
 
 if [ -d "$DIR/.git" ]
 then (
-   cd $DIR
+   cd "$DIR"
git rebase --abort &>/dev/null || :
git checkout -qf "$BRANCH"
git fetch -q
diff --git a/bin/clupdate-svn-repo b/bin/clupdate-svn-repo
index 109e041..2ca4cda 100755
--- a/bin/clupdate-svn-repo
+++ b/bin/clupdate-svn-repo
@@ -1,14 +1,13 @@
 #!/bin/bash
-set -e
-set -u
+set -o nounset -o pipefail -o errexit
 
 URL=$1
 DIR=$2
 
 if [ -d "$DIR/.svn" ]
-then
+then (
cd "$DIR"
svn up -q "$DIR"
-else
+) else
svn checkout -q "$URL" "$DIR"
 fi
diff --git a/bin/createmi b/bin/createmi
index 7a9ac1f..a91dfbd 100755
--- a/bin/createmi
+++ b/bin/createmi
@@ -1,4 +1,5 @@
 #!/bin/bash
+set -o nounset -o pipefail -o errexit
 # ensure correct permissions
 
 sudo -u betawiki hhvm -vEval.Jit=false 
/srv/mediawiki/targets/production/extensions/Translate/scripts/createMessageIndex.php
 --quiet
diff --git a/bin/fuzzy b/bin/fuzzy
index 7fe1cbb..15a22d7 100755
--- a/bin/fuzzy
+++ b/bin/fuzzy
@@ -1,7 +1,6 @@
 #!/bin/bash
-# fuzzy dry run
-# $1 message ID
-# $2 reason
+set -o nounset -o pipefail -o errexit
+
 if [ "$#" -gt "2" ]; then
echo "Only two parameters allowed for fuzzy dry run:"
echo "\$1 is the message key (replace spaces by underscores; use a 
trailing /)"
@@ -10,4 +9,4 @@
 fi
 
 cd /srv/mediawiki/targets/production/extensions/Translate/scripts
-php fuzzy.php --skiplanguages=en,test,qqq $1 --comment="$2"
+php fuzzy.php --skiplanguages=en,test,qqq "$1" --comment="$2"
diff --git a/bin/fuzzyr b/bin/fuzzyr
index 38d44ff..72a05a0 100755
--- a/bin/fuzzyr
+++ b/bin/fuzzyr
@@ -1,5 +1,6 @@
 #!/bin/bash
-# fuzzy dry run
+set -o nounset -o pipefail -o errexit
+
 if [ "$#" -gt "2" ]; then
echo "Only two parameters allowed for fuzzy:"
echo "\$1 is the message key (replace spaces by underscores; use a 
trailing /)"
@@ -8,4 +9,4 @@
 fi
 
 cd /srv/mediawiki/targets/production/extensions/Translate/scripts
-php fuzzy.php --skiplanguages=en,test,qqq $1 --really --comment="$2"
+php fuzzy.php --skiplanguages=en,test,qqq "$1" --really --comment="$2"

-- 
To view, visit https://gerrit.wikimedia.org/r/402341
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia36bbf19a0c634f9047a042339b390dbe033444c
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Update rest of the scripts

2018-01-05 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402341 )

Change subject: Update rest of the scripts
..

Update rest of the scripts

Change-Id: Ia36bbf19a0c634f9047a042339b390dbe033444c
---
M bin/checkmsg
M bin/clupdate-bzr-repo
M bin/clupdate-git-repo
M bin/clupdate-svn-repo
M bin/createmi
M bin/fuzzy
M bin/fuzzyr
7 files changed, 20 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/41/402341/1

diff --git a/bin/checkmsg b/bin/checkmsg
index 6251489..588faa6 100755
--- a/bin/checkmsg
+++ b/bin/checkmsg
@@ -1,3 +1,7 @@
+#!/bin/bash
+set -o nounset -o pipefail -o errexit
+
 # check if a message is being used. May give some false positives.
 # use 'grep -v to clean up.
-grep -r $1 $PWD/* |egrep -v 
"(svn|[.]ser|[.]cdb|i18n[.]php|Messages[A-Z]|l10n_cache|messages-mediawiki-bw_)"
+grep -r "$1" "$PWD"/* |
+   grep -vE 
"(svn|[.]ser|[.]cdb|i18n[.]php|Messages[A-Z]|l10n_cache|messages-mediawiki-bw_)"
diff --git a/bin/clupdate-bzr-repo b/bin/clupdate-bzr-repo
index 3eb9f70..6df3f9c 100755
--- a/bin/clupdate-bzr-repo
+++ b/bin/clupdate-bzr-repo
@@ -1,6 +1,5 @@
 #!/bin/bash
-set -e
-set -u
+set -o nounset -o pipefail -o errexit
 
 URL=$1
 DIR=$2
@@ -12,5 +11,5 @@
bzr revert --quiet
bzr pull "$BRANCH" --quiet --overwrite
 else
-   bzr checkout ${URL}/${BRANCH} "$DIR"
+   bzr checkout "${URL}/${BRANCH}" "$DIR"
 fi
diff --git a/bin/clupdate-git-repo b/bin/clupdate-git-repo
index 018362b..e80be77 100755
--- a/bin/clupdate-git-repo
+++ b/bin/clupdate-git-repo
@@ -1,12 +1,7 @@
 #!/bin/bash
-set -e
-set -u
+set -o nounset -o pipefail -o errexit
 
-DIRSCRIPT="`dirname \"$0\"`"
-DIRSCRIPT="`( cd \"$DIRSCRIPT\" && pwd )`"
-
-ME=`basename "$0"`
-
+ME=$(basename "$0")
 URL=$1
 DIR=$2
 BRANCH=${3:-master}
@@ -14,7 +9,7 @@
 
 if [ -d "$DIR/.git" ]
 then (
-   cd $DIR
+   cd "$DIR"
git rebase --abort &>/dev/null || :
git checkout -qf "$BRANCH"
git fetch -q
diff --git a/bin/clupdate-svn-repo b/bin/clupdate-svn-repo
index 109e041..2ca4cda 100755
--- a/bin/clupdate-svn-repo
+++ b/bin/clupdate-svn-repo
@@ -1,14 +1,13 @@
 #!/bin/bash
-set -e
-set -u
+set -o nounset -o pipefail -o errexit
 
 URL=$1
 DIR=$2
 
 if [ -d "$DIR/.svn" ]
-then
+then (
cd "$DIR"
svn up -q "$DIR"
-else
+) else
svn checkout -q "$URL" "$DIR"
 fi
diff --git a/bin/createmi b/bin/createmi
index 7a9ac1f..a91dfbd 100755
--- a/bin/createmi
+++ b/bin/createmi
@@ -1,4 +1,5 @@
 #!/bin/bash
+set -o nounset -o pipefail -o errexit
 # ensure correct permissions
 
 sudo -u betawiki hhvm -vEval.Jit=false 
/srv/mediawiki/targets/production/extensions/Translate/scripts/createMessageIndex.php
 --quiet
diff --git a/bin/fuzzy b/bin/fuzzy
index 7fe1cbb..15a22d7 100755
--- a/bin/fuzzy
+++ b/bin/fuzzy
@@ -1,7 +1,6 @@
 #!/bin/bash
-# fuzzy dry run
-# $1 message ID
-# $2 reason
+set -o nounset -o pipefail -o errexit
+
 if [ "$#" -gt "2" ]; then
echo "Only two parameters allowed for fuzzy dry run:"
echo "\$1 is the message key (replace spaces by underscores; use a 
trailing /)"
@@ -10,4 +9,4 @@
 fi
 
 cd /srv/mediawiki/targets/production/extensions/Translate/scripts
-php fuzzy.php --skiplanguages=en,test,qqq $1 --comment="$2"
+php fuzzy.php --skiplanguages=en,test,qqq "$1" --comment="$2"
diff --git a/bin/fuzzyr b/bin/fuzzyr
index 38d44ff..72a05a0 100755
--- a/bin/fuzzyr
+++ b/bin/fuzzyr
@@ -1,5 +1,6 @@
 #!/bin/bash
-# fuzzy dry run
+set -o nounset -o pipefail -o errexit
+
 if [ "$#" -gt "2" ]; then
echo "Only two parameters allowed for fuzzy:"
echo "\$1 is the message key (replace spaces by underscores; use a 
trailing /)"
@@ -8,4 +9,4 @@
 fi
 
 cd /srv/mediawiki/targets/production/extensions/Translate/scripts
-php fuzzy.php --skiplanguages=en,test,qqq $1 --really --comment="$2"
+php fuzzy.php --skiplanguages=en,test,qqq "$1" --really --comment="$2"

-- 
To view, visit https://gerrit.wikimedia.org/r/402341
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia36bbf19a0c634f9047a042339b390dbe033444c
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits