Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/76500


Change subject: mw-update-l10n: only copy when files differs
......................................................................

mw-update-l10n: only copy when files differs

On beta cluster, MW_COMMON_SOURCE and MW_COMMON ends up pointing to the
same directory wich is a NFS share.  That made the copy of
ExtensionMessages-master.php to fails because cp cant copy a file over
itself.

That broke l10nupdate for quite sometime. The workaround is to only copy
when MW_COMMON_SOURCE and MW_COMMON are different path by using readlink
to lookup the symbolic links.

Change-Id: I4944a0def72cdce85ddc6b6544652b49ec7da4f1
---
M files/scap/mw-update-l10n
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/76500/1

diff --git a/files/scap/mw-update-l10n b/files/scap/mw-update-l10n
index 8610918..584e1d9 100755
--- a/files/scap/mw-update-l10n
+++ b/files/scap/mw-update-l10n
@@ -54,9 +54,15 @@
        echo "done"
 
        # Update ExtensionMessages-*.php in the local copy
-       sudo -u mwdeploy \
-               cp 
$MW_COMMON_SOURCE/wmf-config/ExtensionMessages-"$mwVerNum".php 
$MW_COMMON/wmf-config/ \
-               || die
+       # Though only when commons are different files. Beta has everything on 
the same
+       # shared filesystem and thus cp would complain about copying to the 
same file.
+       if [ `readlink -f $MW_COMMON_SOURCE` != `readlink -f $MW_COMMON` ]; then
+               echo "Copying to local copy..."
+               sudo -u mwdeploy \
+                       cp 
$MW_COMMON_SOURCE/wmf-config/ExtensionMessages-"$mwVerNum".php 
$MW_COMMON/wmf-config/ \
+                       || die
+               echo "done"
+       fi
 
        echo -n "Updating LocalisationCache for $mwVerNum... "
        sudo -u l10nupdate $BINDIR/mwscript rebuildLocalisationCache.php 
--wiki="$mwDbName" \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4944a0def72cdce85ddc6b6544652b49ec7da4f1
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to