X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mw-setup-script;h=1c356d4e587149fba6306c5994d677391b45a540;hb=ce5dbd53563bcdf13451a7226566447dcc9a519f;hp=7aca959fb344d62421125abdb9cefd5b0a405647;hpb=44712fafcec81eae9e1908d004054e54b3b5b523;p=mediawiki-setup
diff --git a/mw-setup-script b/mw-setup-script
index 7aca959..1c356d4 100755
--- a/mw-setup-script
+++ b/mw-setup-script
@@ -1,10 +1,8 @@
#!/bin/bash
# Copyright (C) 2016 Ian Kelling
# This program is under GPL v. 3 or later, see
+set -x
#
-#
#
#
#
-sed -i "/\\\$wgGroupPermissions\\['\\*'\\]\\['createaccount'\\] = false;/d" $mwc
+sed -i --follow-symlinks "/\\\$wgGroupPermissions\\['\\*'\\]\\['createaccount'\\] = false;/d" $mwc
#
#
# get repo
@@ -550,54 +536,40 @@ div#mw-content-text {
""")
EOF
-python pwb.py ${mwfamily}_setup
+# this can spam a warning, so uniq it
+python pwb.py ${mwfamily}_setup |& uniq
#
#
s=/etc/cron.daily/mediawiki_update
dd of=$s<<'EOF'
#!/bin/bash
source ~/mw_vars
-cd $mw
-git fetch --all
-git checkout origin/$mw_branch
-git rebase ian/REL1_23-toolbox-in-dropdown
-cd extensions
-for x in *; do
- if [[ -d $x ]]; then
- cd $x
- git fetch --all
- git checkout origin/$mw_branch || git checkout -qf origin/master
- cd ..
+update() {
+ dir=$1
+ cd $mw
+ [[ -d $dir ]] || return 1
+ cd $dir
+ branch=$(git describe --all)
+ branch=${branch#remotes/}
+ git fetch --all -q
+ new_head=$(git rev-parse $branch)
+ log=$(git log HEAD..$new_head)
+ if [[ ! $log ]]; then
+ return 1
fi
+ pwd
+ echo "$log"
+ git checkout -qf $new_head
+ cd $mw
+ return 0
+}
+for dir in extensions/* skins/* vendor; do
+ update "$dir" ||:
done
-php $mw/maintenance/update.php -q
-EOF
-chmod +x $s
-#
-#
-# based on recommendation from install page
-if ! dpkg -s php5-gd &>/dev/null; then
- apt-get install -y php5-gd
- service apache2 restart
+if update .; then
+ curl "https://iankelling.org/git/?p=mediawiki-librejs-patch;a=blob_plain;f=mediawiki-1.28-librejs.patch;hb=HEAD" | patch -r - -N -p1
fi
-
-# docs suggests using separate database user
-mysql -u root -p$dbpass <
-#
-git clone https://github.com/DaSchTour/piwik-mediawiki-extension.git $mw/extensions/Piwik
-mw-ext Piwik
-teeu $mwc <