Nikerabbit has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/394294 )
Change subject: Merge repoconfig.yaml and repoconfig.commit.yaml
......................................................................
Merge repoconfig.yaml and repoconfig.commit.yaml
One config can now have multiple different variants. Variant name
is given after | character. Variant overrides must be set after
the default value (without any variant) is set. Variants can be
set at any point in the structure.
New repoconfig.yaml is generated programmatically by merging the
two files.
Variant can be choosen with the --variant option. If no value is
specified for that variant, it will fallback to the default value.
I hacked the repo* scripts to support VARIANT environment variable
so that one now has to do VARIANT=export repoupdate foo (similarly
for repoexport and repocommit) when exporting.
Change-Id: Ia4638c1e2688c4e2af29d45b9f82ec31a20cb26a
---
M bin/nike-export-all
M bin/repo
M bin/repocommit
M bin/repoexport
M bin/repoupdate
M repoconfig.yaml
M repong/repong.php
7 files changed, 146 insertions(+), 21 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/translatewiki
refs/changes/94/394294/1
diff --git a/bin/nike-export-all b/bin/nike-export-all
index e6e65df..0496501 100755
--- a/bin/nike-export-all
+++ b/bin/nike-export-all
@@ -59,6 +59,7 @@
(
eval `ssh-agent -s`
ssh-add /home/betawiki/id_rsa
+ export VARIANT=export
for i in $PROJECTS; do
echo "${_b}$i${b_}"
diff --git a/bin/repo b/bin/repo
index 41705fa..4065e22 100755
--- a/bin/repo
+++ b/bin/repo
@@ -12,4 +12,5 @@
echo "$(date --rfc-3339=seconds --utc) [$(whoami) at $DIR] $0 $@" >> ${DIRLOG}
+unset VARIANT
sudo -u betawiki "${DIRSCRIPT}/repo$COMMAND" "$PROJECT" "$DIR"
diff --git a/bin/repocommit b/bin/repocommit
index ab890b4..21b8547 100755
--- a/bin/repocommit
+++ b/bin/repocommit
@@ -31,7 +31,7 @@
for i in $REPONG; do
if [ "$i" = "$PROJECT" ]
then
- php "$DIRSCRIPT/../repong/repong.php" commit "$PROJECT"
+ php "$DIRSCRIPT/../repong/repong.php" commit "$PROJECT"
--variant "${VARIANT:-default}"
exit 0
fi
done
diff --git a/bin/repoexport b/bin/repoexport
index 88e4fc6..5752b15 100755
--- a/bin/repoexport
+++ b/bin/repoexport
@@ -22,8 +22,8 @@
for i in $REPONG; do
if [ "$i" = "$PROJECT" ]
then
- php "$DIRSCRIPT/../repong/repong.php" export "$PROJECT"
- exit 0;
+ php "$DIRSCRIPT/../repong/repong.php" export "$PROJECT"
--variant "${VARIANT:-default}"
+ exit 0
fi
done
diff --git a/bin/repoupdate b/bin/repoupdate
index f4dc17a..38d3a9d 100755
--- a/bin/repoupdate
+++ b/bin/repoupdate
@@ -48,7 +48,7 @@
for i in $REPONG; do
if [ "$i" = "$PROJECT" ]
then
- php "$DIRSCRIPT/../repong/repong.php" update "$PROJECT"
+ php "$DIRSCRIPT/../repong/repong.php" update "$PROJECT"
--variant "${VARIANT:-default}"
exit 0
fi
done
diff --git a/repoconfig.yaml b/repoconfig.yaml
index f5f4658..c8618f4 100644
--- a/repoconfig.yaml
+++ b/repoconfig.yaml
@@ -9,9 +9,11 @@
blockly:
type: github
url: https://github.com/google/blockly.git
+ url|export: [email protected]:google/blockly.git
blockly-games:
type: github
url: https://github.com/google/blockly-games.git
+ url|export: [email protected]:google/blockly-games.git
citationhunt:
group: citationhunt
@@ -19,6 +21,7 @@
citationhunt:
type: github
url: https://github.com/eggpi/citationhunt.git
+ url|export: [email protected]:eggpi/citationhunt.git
codev:
group: codev
@@ -26,6 +29,7 @@
codev:
type: github
url: https://github.com/mantisbt-plugins/codev.git
+ url|export: [email protected]:mantisbt-plugins/codev.git
commons-android:
group: commons-android-*
@@ -34,6 +38,7 @@
commons-android:
type: github
url: https://github.com/commons-app/apps-android-commons.git
+ url|export: [email protected]:commons-app/apps-android-commons.git
copypatrol:
group: copypatrol
@@ -41,6 +46,7 @@
copypatrol:
type: github
url: https://github.com/wikimedia/CopyPatrol.git
+ url|export: [email protected]:wikimedia/CopyPatrol.git
crosswatch:
group: crosswatch
@@ -48,6 +54,7 @@
crosswatch:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/labs/tools/crosswatch
+ url|export:
ssh://[email protected]:29418/labs/tools/crosswatch
dissemin:
group: dissemin-*
@@ -55,6 +62,7 @@
dissemin:
type: github
url: https://github.com/dissemin/dissemin.git
+ url|export: [email protected]:dissemin/dissemin.git
eol:
group: out-eol-*
@@ -62,6 +70,7 @@
eol:
type: github
url: https://github.com/EOL/eol.git
+ url|export: [email protected]:EOL/eol.git
etherpad-lite:
group: etherpad-lite
@@ -70,6 +79,7 @@
type: github
branch: develop
url: git://github.com/ether/etherpad-lite.git
+ url|export: [email protected]:ether/etherpad-lite.git
freecol:
group: out-freecol
@@ -77,6 +87,7 @@
freecol:
type: git
url: git://git.code.sf.net/p/freecol/git
+ url|export: ssh://[email protected]/p/freecol/git
fudforum:
group: out-fudforum
@@ -84,6 +95,8 @@
fudforum:
type: svn
url:
svn://svn.code.sf.net/p/fudforum/code/trunk/install/forum_data/thm/default/i18n
+ svn-add-options:
config:auto-props:msg=svn:mime-type=text/plain;svn:eol-style=native
+ url|export:
svn+ssh://[email protected]/p/fudforum/code/trunk/install/forum_data/thm/default/i18n
gapfinder:
group: gapfinder
@@ -91,6 +104,7 @@
recommendation-api:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/research/recommendation-api
+ url|export:
ssh://[email protected]:29418/research/recommendation-api
hivejs:
group: hivejs-*
@@ -98,21 +112,27 @@
hivejs/hive-editor-text-codemirror:
type: github
url: https://github.com/hivejs/hive-editor-text-codemirror.git
+ url|export: [email protected]:hivejs/hive-editor-text-codemirror.git
hivejs/hive-plugin-chat:
type: github
url: https://github.com/hivejs/hive-plugin-chat.git
+ url|export: [email protected]:hivejs/hive-plugin-chat.git
hivejs/hive-plugin-export:
type: github
url: https://github.com/hivejs/hive-plugin-export.git
+ url|export: [email protected]:hivejs/hive-plugin-export.git
hivejs/hive-plugin-import:
type: github
url: https://github.com/hivejs/hive-plugin-import.git
+ url|export: [email protected]:hivejs/hive-plugin-import.git
hivejs/hive-plugin-presence:
type: github
url: https://github.com/hivejs/hive-plugin-presence.git
+ url|export: [email protected]:hivejs/hive-plugin-presence.git
hivejs/hive-ui:
type: github
url: https://github.com/hivejs/hive-ui.git
+ url|export: [email protected]:hivejs/hive-ui.git
huggle:
group: huggle
@@ -120,6 +140,7 @@
huggle:
type: github
url: https://github.com/huggle/huggle3-qt-lx.git
+ url|export: [email protected]:huggle/huggle3-qt-lx.git
ia-upload:
group: ia-upload
@@ -127,6 +148,7 @@
ia-upload:
type: github
url: https://github.com/wikisource/ia-upload.git
+ url|export: [email protected]:wikisource/ia-upload.git
inaturalist:
group: out-inaturalist
@@ -135,6 +157,7 @@
type: github
branch: i18n
url: https://github.com/inaturalist/inaturalist.git
+ url|export: [email protected]:inaturalist/inaturalist.git
internetarchivebot:
group: internetarchivebot
@@ -142,6 +165,7 @@
internetarchivebot:
type: github
url: https://github.com/cyberpower678/Cyberbot_II.git
+ url|export: [email protected]:cyberpower678/Cyberbot_II.git
intuition:
group: tsint-*
@@ -150,6 +174,7 @@
intuition:
type: github
url: https://github.com/Krinkle/intuition.git
+ url|export: [email protected]:Krinkle/intuition.git
intuition-tools:
group: int-*
@@ -157,24 +182,31 @@
int-dcatap:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/operations/dumps/dcat
+ url|export:
ssh://[email protected]:29418/operations/dumps/dcat
int-guc:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/labs/tools/guc
+ url|export: ssh://[email protected]:29418/labs/tools/guc
int-heritage:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/labs/tools/heritage
+ url|export: ssh://[email protected]:29418/labs/tools/heritage
int-orphantalk:
type: github
url: https://github.com/Krinkle/mw-tool-orphantalk.git
+ url|export: [email protected]:Krinkle/mw-tool-orphantalk.git
int-raun:
type: github
url: https://github.com/kenrick95/Raun.git
+ url|export: [email protected]:kenrick95/Raun.git
int-refill:
type: git
url: https://github.com/zhaofengli/refill.git
+ url|export: [email protected]:zhaofengli/refill.git
int-web:
type: github
url: https://github.com/Krinkle/intuition-web.git
+ url|export: [email protected]:Krinkle/intuition-web.git
jquery.uls:
group: jquery-uls
@@ -182,6 +214,7 @@
jquery.uls:
type: github
url: https://github.com/wikimedia/jquery.uls.git
+ url|export: [email protected]:wikimedia/jquery.uls.git
kiwix:
group: kiwix
@@ -189,6 +222,7 @@
kiwix:
type: github
url: https://github.com/kiwix/maintenance.git
+ url|export: [email protected]:kiwix/maintenance.git
lib.reviews:
group: lib.reviews
@@ -196,6 +230,7 @@
lib.reviews:
type: github
url: https://github.com/eloquence/lib.reviews.git
+ url|export: [email protected]:eloquence/lib.reviews.git
mantis:
group: out-mantis*
@@ -205,6 +240,7 @@
options:
- codemaponly
url: https://github.com/mantisbt/mantisbt.git
+ url|export: [email protected]:mantisbt/mantisbt.git
mathjax:
group: out-mathjax-*
@@ -212,9 +248,10 @@
mathjax:
type: github
url: https://github.com/mathjax/MathJax-i18n.git
+ url|export: [email protected]:mathjax/MathJax-i18n.git
mediawiki:
- always-export-languages: en-gb,es-formal,de-formal,hu-formal,nl-informal
+ always-export-languages:
en-ca,en-gb,es-formal,de-formal,de-at,de-ch,hu-formal,nl-informal
no-export-languages:
test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,gom,hif,kbd,kk,kk-cn,iu,kk-kz,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
export-hours: 200
export-threshold: 13
@@ -223,6 +260,7 @@
mediawiki/master:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/mediawiki/core
+ url|export: ssh://[email protected]:29418/mediawiki/core
mifos:
group: out-mifos
@@ -232,6 +270,7 @@
type: github
branch: develop
url: https://github.com/openMF/community-app.git
+ url|export: [email protected]:openMF/community-app.git
mwgerrit:
group: mwgerrit-*
@@ -239,94 +278,124 @@
mwgerrit/data-values/value-view:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/data-values/value-view
+ url|export:
ssh://[email protected]:29418/data-values/value-view
mwgerrit/oojs/ui:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/oojs/ui
+ url|export: ssh://[email protected]:29418/oojs/ui
mwgerrit/VisualEditor/VisualEditor:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/VisualEditor/VisualEditor
+ url|export:
ssh://[email protected]:29418/VisualEditor/VisualEditor
mwgithub:
+ always-export-languages:
en-ca,en-gb,es-formal,de-formal,de-at,de-ch,hu-formal,nl-informal
group: mwgithub-*,mediawiki-skingithub-*
repos:
mwgithub/cmln/Chameleon:
type: github
url: https://github.com/cmln/chameleon.git
+ url|export: [email protected]:cmln/chameleon.git
mwgithub/Hutchy68/Purge:
type: github
url: https://github.com/Hutchy68/Purge.git
+ url|export: [email protected]:Hutchy68/Purge.git
mwgithub/jeblad/Pickle:
type: github
url: https://github.com/jeblad/Pickle.git
+ url|export: [email protected]:jeblad/Pickle.git
mwgithub/JeroenDeDauw/GitHub:
type: github
url: https://github.com/JeroenDeDauw/GitHub.git
+ url|export: [email protected]:JeroenDeDauw/GitHub.git
mwgithub/JeroenDeDauw/Maps:
type: github
url: https://github.com/JeroenDeDauw/Maps.git
+ url|export: [email protected]:JeroenDeDauw/Maps.git
mwgithub/JeroenDeDauw/ParserHooks:
type: github
url: https://github.com/JeroenDeDauw/ParserHooks.git
+ url|export: [email protected]:JeroenDeDauw/ParserHooks.git
mwgithub/JeroenDeDauw/SubPageList:
type: github
url: https://github.com/JeroenDeDauw/SubPageList.git
+ url|export: [email protected]:JeroenDeDauw/SubPageList.git
mwgithub/JeroenDeDauw/Validator:
type: github
url: https://github.com/JeroenDeDauw/Validator.git
+ url|export: [email protected]:JeroenDeDauw/Validator.git
mwgithub/Nikerabbit/mediawiki-extensions-FinnFrameNet:
type: github
url: https://github.com/Nikerabbit/mediawiki-extensions-FinnFrameNet.git
+ url|export:
[email protected]:Nikerabbit/mediawiki-extensions-FinnFrameNet.git
mwgithub/OrganicDesign/extensions:
type: github
url: https://github.com/OrganicDesign/extensions
+ url|export: [email protected]:OrganicDesign/extensions
mwgithub/SemanticMediaWiki/SemanticBreadcrumbLinks:
type: github
url: https://github.com/SemanticMediaWiki/SemanticBreadcrumbLinks.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticBreadcrumbLinks.git
mwgithub/SemanticMediaWiki/SemanticCite:
type: github
url: https://github.com/SemanticMediaWiki/SemanticCite.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticCite.git
mwgithub/SemanticMediaWiki/SemanticCompoundQueries:
type: github
url: https://github.com/SemanticMediaWiki/SemanticCompoundQueries.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticCompoundQueries.git
mwgithub/SemanticMediaWiki/SemanticExternalQueryLookup:
type: github
url: https://github.com/SemanticMediaWiki/SemanticExternalQueryLookup.git
+ url|export:
[email protected]:SemanticMediaWiki/SemanticExternalQueryLookup.git
mwgithub/SemanticMediaWiki/SemanticExtraSpecialProperties:
type: github
url:
https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties.git
+ url|export:
[email protected]:SemanticMediaWiki/SemanticExtraSpecialProperties.git
mwgithub/SemanticMediaWiki/SemanticFormsSelect:
type: github
url: https://github.com/SemanticMediaWiki/SemanticFormsSelect.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticFormsSelect.git
mwgithub/SemanticMediaWiki/SemanticGlossary:
type: github
url: https://github.com/SemanticMediaWiki/SemanticGlossary.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticGlossary.git
mwgithub/SemanticMediaWiki/SemanticInterlanguageLinks:
type: github
url: https://github.com/SemanticMediaWiki/SemanticInterlanguageLinks.git
+ url|export:
[email protected]:SemanticMediaWiki/SemanticInterlanguageLinks.git
mwgithub/SemanticMediaWiki/SemanticMediaWiki:
type: github
url: https://github.com/SemanticMediaWiki/SemanticMediaWiki.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticMediaWiki.git
mwgithub/SemanticMediaWiki/SemanticResultFormats:
type: github
url: https://github.com/SemanticMediaWiki/SemanticResultFormats.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticResultFormats.git
mwgithub/SemanticMediaWiki/SemanticMetaTags:
type: github
url: https://github.com/SemanticMediaWiki/SemanticMetaTags.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticMetaTags.git
mwgithub/SemanticMediaWiki/SemanticScribunto:
type: github
url: https://github.com/SemanticMediaWiki/SemanticScribunto.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticScribunto.git
mwgithub/SemanticMediaWiki/SemanticSignup:
type: github
url: https://github.com/SemanticMediaWiki/SemanticSignup.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticSignup.git
mwgithub/SemanticMediaWiki/SemanticWatchlist:
type: github
url: https://github.com/SemanticMediaWiki/SemanticWatchlist.git
+ url|export: [email protected]:SemanticMediaWiki/SemanticWatchlist.git
mwgithub/SemanticMediaWiki/SummaryCards:
type: github
url: https://github.com/SemanticMediaWiki/SummaryCards.git
+ url|export: [email protected]:SemanticMediaWiki/SummaryCards.git
mwgithub/SemanticMediaWiki/WhatsNearby:
type: github
url: https://github.com/SemanticMediaWiki/WhatsNearby.git
+ url|export: [email protected]:SemanticMediaWiki/WhatsNearby.git
nfcring-control:
group: nfcring-control
@@ -334,6 +403,7 @@
nfcring-control:
type: github
url: https://github.com/mclear/NFC_Ring_Control.git
+ url|export: [email protected]:mclear/NFC_Ring_Control.git
nocc:
group: out-nocc-*
@@ -341,6 +411,7 @@
nocc:
type: svn
url: https://svn.code.sf.net/p/nocc/code/trunk
+ url|export: svn+ssh://[email protected]/p/nocc/code/trunk
oppia:
group: oppia
@@ -349,6 +420,8 @@
type: github
branch: develop
url: https://github.com/oppia/oppia.git
+ branch|export: translatewiki
+ url|export: [email protected]:oppia/oppia.git
osm:
no-export-languages: en,qqq
@@ -357,9 +430,11 @@
osm:
type: github
url: https://github.com/openstreetmap/openstreetmap-website.git
+ url|export: [email protected]:openstreetmap/openstreetmap-website.git
potlatch2:
type: github
url: https://github.com/systemed/potlatch2.git
+ url|export: [email protected]:systemed/potlatch2.git
pageviews:
group: pageviews
@@ -367,6 +442,7 @@
pageviews:
type: github
url: https://github.com/MusikAnimal/pageviews.git
+ url|export: [email protected]:MusikAnimal/pageviews.git
proveit:
group: proveit
@@ -374,6 +450,7 @@
proveit:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/wikipedia/gadgets/ProveIt
+ url|export:
ssh://[email protected]:29418/wikipedia/gadgets/ProveIt
pywikibot:
group: out-pywikipedia-*
@@ -382,6 +459,7 @@
pywikibot:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/pywikibot/i18n
+ url|export: ssh://[email protected]:29418/pywikibot/i18n
vicuna:
group: out-vicuna
@@ -389,6 +467,7 @@
vicuna:
type: github
url: https://github.com/yarl/vicuna.git
+ url|export: [email protected]:yarl/vicuna.git
video2commons:
group: video2commons
@@ -396,6 +475,7 @@
video2commons:
type: github
url: https://github.com/Toollabs/video2commons.git
+ url|export: [email protected]:Toollabs/video2commons.git
waymarked-trails-site:
group: out-waymarked-trails*
@@ -403,6 +483,7 @@
waymarked-trails-site:
type: github
url: https://github.com/lonvia/waymarked-trails-site.git
+ url|export: [email protected]:lonvia/waymarked-trails-site.git
wiki-ai:
group: wiki-ai-*
@@ -410,9 +491,11 @@
wiki-ai/wikilabels:
type: github
url: https://github.com/wiki-ai/wikilabels.git
+ url|export: [email protected]:wiki-ai/wikilabels.git
wiki-ai/wikilabels-wikimedia-config:
type: github
url: https://github.com/wiki-ai/wikilabels-wmflabs-deploy.git
+ url|export: [email protected]:wiki-ai/wikilabels-wmflabs-deploy.git
wikiblame:
group: wikiblame
@@ -421,6 +504,7 @@
wikiblame:
type: github
url: https://github.com/FlominatorTM/wikiblame.git
+ url|export: [email protected]:FlominatorTM/wikiblame.git
wikidata:
group: wikidata-*
@@ -428,6 +512,7 @@
wikidata/query/gui:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/wikidata/query/gui
+ url|export: ssh://[email protected]:29418/wikidata/query/gui
wikiedudashboard:
group: wikiedudashboard
@@ -436,6 +521,7 @@
wikiedudashboard:
type: github
url: https://github.com/WikiEducationFoundation/WikiEduDashboard.git
+ url|export: [email protected]:WikiEducationFoundation/WikiEduDashboard.git
wikimania:
group: out-wikimania-scholarships-app
@@ -443,6 +529,7 @@
wikimania:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/wikimedia/wikimania-scholarships
+ url|export:
ssh://[email protected]:29418/wikimedia/wikimania-scholarships
wikimedia-portals:
group: wikimedia-portals
@@ -450,6 +537,7 @@
wikimedia-portals:
type: wmgerrit
url: https://gerrit.wikimedia.org/r/wikimedia/portals
+ url|export: ssh://[email protected]:29418/wikimedia/portals
wikinity:
group: wikinity
@@ -457,6 +545,7 @@
wikinity:
type: github
url: https://github.com/urbanecm/wikinity.git
+ url|export: [email protected]:urbanecm/wikinity.git
wikipedia-android:
group: out-wikimedia-mobile-wikipedia-android-*
@@ -465,6 +554,7 @@
type: wmgerrit
url: https://gerrit.wikimedia.org/r/apps/android/wikipedia
auto-merge: false
+ url|export:
ssh://[email protected]:29418/apps/android/wikipedia
wikipedia-ios:
group: out-wikimedia-mobile-wikipedia-ios
@@ -473,6 +563,8 @@
type: github
branch: develop
url: https://github.com/wikimedia/wikipedia-ios.git
+ branch|export: twn
+ url|export: [email protected]:wikimedia/wikipedia-ios.git
xtools:
group: xtools
@@ -480,3 +572,4 @@
xtools:
type: github
url: https://github.com/x-tools/xtools.git
+ url|export: [email protected]:x-tools/xtools.git
diff --git a/repong/repong.php b/repong/repong.php
index a9d3ed3..996c48b 100644
--- a/repong/repong.php
+++ b/repong/repong.php
@@ -5,6 +5,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Exception\ProcessTimedOutException;
@@ -37,7 +38,6 @@
$yaml = file_get_contents( $configFile );
$this->config = yaml_parse( $yaml );
- var_dump( $this->config );
$cores = preg_match_all( '/^processor/m', file_get_contents(
'/proc/cpuinfo' ) );
if ( $cores ) {
@@ -68,11 +68,38 @@
}
}
- protected function getConfig( $project ) {
- if ( !isset( $this->config[$project] ) ) {
+ protected function getConfig( $project, $targetVariant = null ) {
+ if ( !isset( $this->config[ $project ] ) ) {
echo "Unknown project $project\n";
- die();
+ exit( 1 );
}
+
+ $config = $this->config[ $project ];
+ // Reference is needed for recursive closure to work
+ $replacer = function ( $array ) use ( &$replacer,
$targetVariant ) {
+ $new = [];
+ foreach ( $array as $key => $value ) {
+ $split = strpos( $key, '|' );
+ if ( $split !== false ) {
+ $variant = substr( $key, $split + 1 );
+ if ( $variant === $targetVariant ) {
+ $key = substr( $key, 0, $split
);
+ } else {
+ // Some other variant, drop it
+ continue;
+ }
+ }
+
+ if ( is_array( $value ) ) {
+ $value = $replacer( $value );
+ }
+
+ // Assumption: custom variants always come
after default variant.
+ // Otherwise the default would override the
custom one.
+ $new[$key] = $value;
+ }
+ return $new;
+ };
return $this->config[$project];
}
@@ -174,15 +201,16 @@
class UpdateCommand extends RepoNgCommand {
protected function configure() {
+ parent::configure();
$this->setName( 'update' );
- $this->setDefinition( [
- new InputArgument( 'project', InputArgument::REQUIRED ),
- ] );
+ $this->addArgument( 'project', InputArgument::REQUIRED );
+ $this->addOption( 'variant', null, InputOption::VALUE_REQUIRED
);
}
protected function execute( InputInterface $input, OutputInterface
$output ) {
$project = $input->getArgument( 'project' );
- $config = $this->getConfig( $project );
+ $variant = $input->getOption( 'variant' );
+ $config = $this->getConfig( $project, $variant );
$base = $this->getBase();
$bindir = $this->bindir;
@@ -223,15 +251,16 @@
class ExportCommand extends RepoNgCommand {
protected function configure() {
+ parent::configure();
$this->setName( 'export' );
- $this->setDefinition( [
- new InputArgument( 'project', InputArgument::REQUIRED ),
- ] );
+ $this->addArgument( 'project', InputArgument::REQUIRED );
+ $this->addOption( 'variant', null, InputOption::VALUE_REQUIRED
);
}
protected function execute( InputInterface $input, OutputInterface
$output ) {
$project = $input->getArgument( 'project' );
- $config = $this->getConfig( $project );
+ $variant = $input->getOption( 'variant' );
+ $config = $this->getConfig( $project, $variant );
$exporter = $this->config['@meta']['export'];
$expander = $this->config['@meta']['expand'];
@@ -299,15 +328,16 @@
class CommitCommand extends RepoNgCommand {
protected function configure() {
+ parent::configure();
$this->setName( 'commit' );
- $this->setDefinition( [
- new InputArgument( 'project', InputArgument::REQUIRED ),
- ] );
+ $this->addArgument( 'project', InputArgument::REQUIRED );
+ $this->addOption( 'variant', null, InputOption::VALUE_REQUIRED
);
}
protected function execute( InputInterface $input, OutputInterface
$output ) {
$project = $input->getArgument( 'project' );
- $config = $this->getConfig( $project );
+ $variant = $input->getOption( 'variant' );
+ $config = $this->getConfig( $project, $variant );
$message = 'Localisation updates from
https://translatewiki.net.';
$base = $this->getBase();
--
To view, visit https://gerrit.wikimedia.org/r/394294
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4638c1e2688c4e2af29d45b9f82ec31a20cb26a
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits