Faidon has submitted this change and it was merged.

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 which 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(-)

Approvals:
  Aude: Looks good to me, but someone else must approve
  Hashar: Looks good to me, but someone else must approve
  Faidon: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I4944a0def72cdce85ddc6b6544652b49ec7da4f1
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Faidon <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to