Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343604 )

Change subject: Stop duplicating INSTALL notes
......................................................................

Stop duplicating INSTALL notes

Instead, load them from the wiki.

Change-Id: I58a308a29267ef0911b6cb4e4216a2abf50b1c22
---
M melange/BundleCreater.php
D melange/INSTALL.MediaWikiLanguageExtensionBundle
M melange/config.ini
3 files changed, 16 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/04/343604/1

diff --git a/melange/BundleCreater.php b/melange/BundleCreater.php
index 9f7169d..7421961 100644
--- a/melange/BundleCreater.php
+++ b/melange/BundleCreater.php
@@ -270,6 +270,7 @@
        public function create_archive() {
                chdir( $this->dir );
 
+               $piggyurl = $this->conf['common']['piggyurl'];
                $piggyfile = $this->conf['common']['piggyfile'];
                $hasher = $this->conf['common']['hasher'];
 
@@ -277,6 +278,20 @@
                        mkdir( 'releases' );
                }
 
+               // XXX: generalize
+               if ( $piggyurl ) {
+                       $json = file_get_contents( $piggyurl );
+                       $data = json_decode( $json, true );
+                       $data = 
$data['query']['pages'][0]['revisions'][0]['content'];
+                       $data = preg_replace( 
'~<noinclude>.*?</noinclude>\s*~s', '', $data );
+                       $data = str_replace(
+                               '{{:MediaWiki Language Extension 
Bundle/latest}}',
+                               $this->conf['common']['releasever'],
+                               $data
+                       );
+                       file_put_contents( $piggyfile, $data );
+               }
+
                $filename = $this->getReleaseFileName();
 
                $tarname = escapeshellarg( "releases/$filename" );
diff --git a/melange/INSTALL.MediaWikiLanguageExtensionBundle 
b/melange/INSTALL.MediaWikiLanguageExtensionBundle
deleted file mode 100644
index 1fde96a..0000000
--- a/melange/INSTALL.MediaWikiLanguageExtensionBundle
+++ /dev/null
@@ -1,69 +0,0 @@
-== Installation ==
-
-=== extensions in subdirectory ===
-
-If your directory layout looks like this:
- ./mediawiki/extensions/{A,B,C}
-go to mediawiki directory and extract the release file:
- tar xjf MediaWikiLanguageExtensionBundle-{{/latest}}.tar.bz2
-
-The variable you have to add to your LocalSettings.php before the 
configuration below is:
- $EXT = "$IP/extensions";
-
-=== extensions in top-level directory ===
-
-If your directory layout looks like this:
- ./mediawiki/
- ./extensions/{A,B,C}
-go to common parent directory and extract the release file:
- tar xjf MediaWikiLanguageExtensionBundle-{{/latest}}.tar.bz2
-
-The variables you have to add to your LocalSettings.php before the 
configuration below is:
- $EXT = "$IP/../extensions";
- $wgExtensionAssetsPath = "{$wgScriptPath}/../extensions";
-
-=== Add/update your LocalSettings.php ===
-Near the end, you have to place the configuration lines given above (pick from 
one of the two sections) followed by this:
-
-wfLoadExtension( 'Babel' );
-
-wfLoadExtension( 'cldr' );
-
-wfLoadExtension( 'CleanChanges' );
-$wgCCTrailerFilter = true;
-$wgCCUserFilter = false;
-$wgDefaultUserOptions['usenewrc'] = 1;
-
-wfLoadExtension( 'LocalisationUpdate' );
-$wgLocalisationUpdateDirectory = "$IP/cache";
-
-require_once "$EXT/Translate/Translate.php";
-$wgGroupPermissions['user']['translate'] = true;
-$wgGroupPermissions['user']['translate-messagereview'] = true;
-$wgGroupPermissions['user']['translate-groupreview'] = true;
-$wgGroupPermissions['user']['translate-import'] = true;
-$wgGroupPermissions['sysop']['pagetranslation'] = true;
-$wgGroupPermissions['sysop']['translate-manage'] = true;
-$wgTranslateDocumentationLanguageCode = 'qqq';
-$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic 
content. Used for documenting messages
-
-wfLoadExtension( 'UniversalLanguageSelector' );
-
-=== Update database tables ===
-==== Command line ====
-In the directory where your LocalSettings.php is located, run the following 
command:
- php maintenance/update.php
-
-==== Web browser ====
-Go to example.com/mediawiki/mw-config/ by using your domain and path and rerun 
install.
-
-=== Configuring and using extensions ===
-See the respective extension documentation pages. Do note that 
LocalisationUpdate does nothing by
-default and needs additional configuration to be run periodically.
-
-* https://www.mediawiki.org/wiki/Extension:Babel
-* https://www.mediawiki.org/wiki/Extension:CLDR
-* https://www.mediawiki.org/wiki/Extension:CleanChanges
-* https://www.mediawiki.org/wiki/Extension:LocalisationUpdate
-* https://www.mediawiki.org/wiki/Extension:UniversalLanguageSelector
-* https://www.mediawiki.org/wiki/Help:Extension:Translate
diff --git a/melange/config.ini b/melange/config.ini
index ed2f72a..a3cfcaf 100644
--- a/melange/config.ini
+++ b/melange/config.ini
@@ -11,6 +11,7 @@
 tagname=$1
 versionextra=[https://www.mediawiki.org/wiki/MLEB MLEB $1]
 testconfig=mwtestconf.php
+piggyurl="https://www.mediawiki.org/w/api.php?action=query&titles=MediaWiki%20Language%20Extension%20Bundle/installation&prop=revisions&rvprop=content&format=json&formatversion=2";
 piggyfile=INSTALL.MediaWikiLanguageExtensionBundle
 
 [extensions]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58a308a29267ef0911b6cb4e4216a2abf50b1c22
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com>

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

Reply via email to