jenkins-bot has submitted this change and it was merged.

Change subject: Make config script more robust.
......................................................................


Make config script more robust.

Make it independent of the current state of LocalSettings.php: Either add
opening and closing PHP tags when the file is closed with one, or don't.

This is necessary because I plan to change when this script is executed by our
CI. At that point the CIs LocalSettings.php is not closed with a PHP tag, where
as when it is currently execute there is a closing PHP tag.

Bug: T97529
Change-Id: Ie5611fd24c0f245b2aceb48610a866c61cf8a4e1
(cherry picked from commit daeed233b32d4f4da6a2eeb51d1beb6cf8d8902c)
---
M build/jenkins/mw-apply-wb-settings.sh
1 file changed, 12 insertions(+), 2 deletions(-)

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



diff --git a/build/jenkins/mw-apply-wb-settings.sh 
b/build/jenkins/mw-apply-wb-settings.sh
index b18bb1a..49d80b7 100755
--- a/build/jenkins/mw-apply-wb-settings.sh
+++ b/build/jenkins/mw-apply-wb-settings.sh
@@ -54,7 +54,14 @@
 
 cd $WORKSPACE/src
 
-echo '<?php' >> LocalSettings.php
+if [ "$(tail -n1 LocalSettings.php)" = "?>" ]
+then
+  PHPTAGS=true
+fi
+if [ -v PHPTAGS ]
+then
+  echo '<?php' >> LocalSettings.php
+fi
 
 apply_experimental_settings
 
@@ -68,4 +75,7 @@
   usage
 fi
 
-echo '?>' >> LocalSettings.php
+if [ -v PHPTAGS ]
+then
+  echo '?>' >> LocalSettings.php
+fi

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5611fd24c0f245b2aceb48610a866c61cf8a4e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: wmf/1.26wmf4
Gerrit-Owner: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: JanZerebecki <jan.wikime...@zerebecki.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to