Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.

Commit bade96a

Browse files
edg2sMatmaRex
authored andcommitted
Only ever iterate over selected repos
This allows us to drop the directory-exists checks.
1 parent ba59cd3 commit bade96a

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

new.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ function set_progress( float $pc, string $label ) {
362362
'SERVER' => $server,
363363
'SERVERPATH' => $serverPath,
364364
'LANGUAGE' => $language,
365+
'REPOSITORIES' => $reposString,
365366
]
366367
);
367368
if ( $error ) {
@@ -384,6 +385,7 @@ function set_progress( float $pc, string $label ) {
384385
'MAINPAGE' => $mainPage,
385386
'USE_PROXY' => $useProxy,
386387
'USE_INSTANT_COMMONS' => $useInstantCommons,
388+
'REPOSITORIES' => $reposString,
387389
]
388390
);
389391
if ( $error ) {

new/install.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ cat $PATCHDEMO/localsettings/core.txt >> $PATCHDEMO/wikis/$NAME/w/LocalSettings.
2222
while IFS=' ' read -r repo dir; do
2323
filename=$(echo $repo | sed "s/\//-/g" | sed "s/^mediawiki-//")
2424
if [ -f $PATCHDEMO/localsettings/$filename.txt ]; then
25-
if [ -d $PATCHDEMO/wikis/$NAME/$dir ]; then
26-
echo -e "\n// $repo" >> $PATCHDEMO/wikis/$NAME/w/LocalSettings.php
27-
cat $PATCHDEMO/localsettings/$filename.txt >> $PATCHDEMO/wikis/$NAME/w/LocalSettings.php
28-
fi
25+
echo -e "\n// $repo" >> $PATCHDEMO/wikis/$NAME/w/LocalSettings.php
26+
cat $PATCHDEMO/localsettings/$filename.txt >> $PATCHDEMO/wikis/$NAME/w/LocalSettings.php
2927
fi
30-
done < $PATCHDEMO/repository-lists/all.txt
28+
done <<< "$REPOSITORIES"
3129

3230
# create htaccess
3331
echo "RewriteEngine On

new/postinstall.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,13 @@ fi
4242
# import extension/skin/service-specific XML dumps
4343
while IFS=' ' read -r repo dir; do
4444
filename=$(echo $repo | sed "s/\//-/g" | sed "s/^mediawiki-//")
45-
if [ -d $PATCHDEMO/wikis/$NAME/$dir ]; then
46-
# matches extension-foo.xml or extension-foo-*.xml
47-
for page in $(find $PATCHDEMO/pages -regextype egrep -regex ".*/$filename(-.+)?.xml" -not -type d -printf '%P\n')
48-
do
49-
echo "Importing $PATCHDEMO/pages/$page"
50-
php $PATCHDEMO/wikis/$NAME/w/maintenance/importDump.php < $PATCHDEMO/pages/$page
51-
done
52-
fi
53-
done < $PATCHDEMO/repository-lists/all.txt
45+
# matches extension-foo.xml or extension-foo-*.xml
46+
for page in $(find $PATCHDEMO/pages -regextype egrep -regex ".*/$filename(-.+)?.xml" -not -type d -printf '%P\n')
47+
do
48+
echo "Importing $PATCHDEMO/pages/$page"
49+
php $PATCHDEMO/wikis/$NAME/w/maintenance/importDump.php < $PATCHDEMO/pages/$page
50+
done
51+
done <<< "$REPOSITORIES"
5452

5553
# import generic XML dumps (core-*.xml)
5654
for page in $(find $PATCHDEMO/pages -name "core-*.xml" -not -type d -printf '%P\n')

0 commit comments

Comments
 (0)