Index: trunk/wikiation/wikiation_check_isolation/settings |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +# depreciated gwicke 08/2008 |
| 3 | +# rest of file now currently unused. WOW! |
| 4 | + |
| 5 | + |
Index: trunk/wikiation/wikiation_check_isolation/LICENSE |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +This software, copyright (C) 2008-2009 by Wikiation. This software is developed by Kim Bruning. |
| 3 | + |
| 4 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 | +of this software and associated documentation files (the "Software"), to deal |
| 6 | +in the Software without restriction, including without limitation the rights to |
| 7 | +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
| 8 | +of the Software, and to permit persons to whom the Software is furnished to do |
| 9 | +so, subject to the following conditions: |
| 10 | + |
| 11 | +The above copyright notice and this permission notice shall be included in all |
| 12 | +copies or substantial portions of the Software. |
| 13 | + |
| 14 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 20 | +SOFTWARE. |
| 21 | + |
| 22 | + |
Index: trunk/wikiation/wikiation_check_isolation/compare_mw.sh |
— | — | @@ -0,0 +1,35 @@ |
| 2 | +#!/bin/sh |
| 3 | +#compare local mediawiki installation with our own copy |
| 4 | + |
| 5 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 6 | +# This software is developed by Kim Bruning. |
| 7 | +# |
| 8 | +# Distributed under the terms of the MIT license. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +if [[ $0 == '/'* ]]; then |
| 13 | + ScriptLocation="`dirname $0`" |
| 14 | +else |
| 15 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 16 | +fi |
| 17 | + |
| 18 | +source $ScriptLocation/settings |
| 19 | +data=$ScriptLocation/data |
| 20 | +current=$ScriptLocation/current |
| 21 | + |
| 22 | +mask=$1 |
| 23 | +detail='-q' |
| 24 | + |
| 25 | +if [[ ( $mask = "--detail" ) || ( $mask = "-d" ) ]]; then |
| 26 | + mask=$2 |
| 27 | + detail='-N' |
| 28 | +fi |
| 29 | + |
| 30 | +mkdir -p $current |
| 31 | + |
| 32 | +if [[ -n $mask ]] ; then |
| 33 | + diff -r $detail -x $mask $mediawiki_location $data/$mediawiki >$current/mwdiff_report |
| 34 | +else |
| 35 | + diff -r $detail $mediawiki_location $data/$mediawiki >$current/mwdiff_report |
| 36 | +fi |
Property changes on: trunk/wikiation/wikiation_check_isolation/compare_mw.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 37 | + |
Index: trunk/wikiation/wikiation_check_isolation/compare_db.sh |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +#!/bin/sh |
| 3 | +# compare database description directories created by |
| 4 | +# dump_desc.sh, and write a report to current/ |
| 5 | + |
| 6 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 7 | +# This software is developed by Kim Bruning. |
| 8 | +# |
| 9 | +# Distributed under the terms of the MIT license. |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +if [[ $0 == '/'* ]]; then |
| 14 | + ScriptLocation="`dirname $0`" |
| 15 | +else |
| 16 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 17 | +fi |
| 18 | + |
| 19 | +data=$ScriptLocation/data |
| 20 | +current=$ScriptLocation/current |
| 21 | + |
| 22 | +mkdir -p $current |
| 23 | + |
| 24 | +$ScriptLocation/dump_desc.sh $current/current_db |
| 25 | + |
| 26 | +diff -rN $data/original_db $current/current_db > $current/dbdiff_report |
Property changes on: trunk/wikiation/wikiation_check_isolation/compare_db.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 27 | + |
Index: trunk/wikiation/wikiation_check_isolation/create_data.sh |
— | — | @@ -0,0 +1,20 @@ |
| 2 | +#!/bin/sh |
| 3 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 4 | +# This software is developed by Kim Bruning. |
| 5 | +# |
| 6 | +# Distributed under the terms of the MIT license. |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +if [[ $0 == '/'* ]]; then |
| 11 | + ScriptLocation="`dirname $0`" |
| 12 | +else |
| 13 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 14 | +fi |
| 15 | + |
| 16 | +data=$ScriptLocation/data |
| 17 | +source $ScriptLocation/settings |
| 18 | + |
| 19 | +mkdir -p $data |
| 20 | +cp -r $mediawiki_location $data |
| 21 | +$ScriptLocation/dump_desc.sh $data/original_db |
Property changes on: trunk/wikiation/wikiation_check_isolation/create_data.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 22 | + |
Index: trunk/wikiation/wikiation_check_isolation/compare_all.sh |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +#!/bin/sh |
| 3 | + |
| 4 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 5 | +# This software is developed by Kim Bruning. |
| 6 | +# |
| 7 | +# Distributed under the terms of the MIT license. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +RED='\e[0;31m' |
| 12 | +GREEN='\e[0;32m' |
| 13 | +NC='\e[0m' # No Color |
| 14 | + |
| 15 | +if [[ $0 == '/'* ]]; then |
| 16 | + ScriptLocation="`dirname $0`" |
| 17 | +else |
| 18 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 19 | +fi |
| 20 | + |
| 21 | +data=$ScriptLocation/data |
| 22 | +current=$ScriptLocation/current |
| 23 | + |
| 24 | +$ScriptLocation/compare_mw.sh $1 $2 |
| 25 | +$ScriptLocation/compare_db.sh |
| 26 | + |
| 27 | +[ ! -s $current/mwdiff_report ] && |
| 28 | + echo -e "$GREEN * $NC After installation no difference found with the original MediaWiki core." |
| 29 | + |
| 30 | +[ ! -s $current/dbdiff_report ] && |
| 31 | + echo -e "$GREEN * $NC After installation no difference found with the structure of the original MediaWiki database." |
| 32 | + |
| 33 | +[ -s $current/mwdiff_report ] && { |
| 34 | + echo |
| 35 | + echo -e "$RED * $NC MediaWiki differences: " |
| 36 | + cat $current/mwdiff_report |
| 37 | +} |
| 38 | + |
| 39 | + |
| 40 | +[ -s $current/dbdiff_report ] && { |
| 41 | + echo |
| 42 | + echo -e "$RED * $NC MediaWiki Database differences: " |
| 43 | + cat $current/dbdiff_report |
| 44 | +} |
Property changes on: trunk/wikiation/wikiation_check_isolation/compare_all.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 45 | + |
Index: trunk/wikiation/wikiation_check_isolation/dl_and_check.sh |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +#!/bin/sh |
| 3 | +#load data on a particular revision |
| 4 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 5 | +# This software is developed by Kim Bruning. |
| 6 | +# |
| 7 | +# Distributed under the terms of the MIT license. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +if [[ $0 == '/'* ]]; then |
| 12 | + ScriptLocation="`dirname $0`" |
| 13 | +else |
| 14 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 15 | +fi |
| 16 | + |
| 17 | +target=$1 |
| 18 | + |
| 19 | +if test -z $target; then |
| 20 | + echo "syntax: wikiation_check_isolation <revision name>" |
| 21 | + exit 0 |
| 22 | +fi |
| 23 | + |
| 24 | +target_dir="/var/www/revisions/$target" |
| 25 | +if test ! -e $target_dir; then |
| 26 | + echo "$target not found" |
| 27 | + exit 0 |
| 28 | +fi |
| 29 | + |
| 30 | + |
| 31 | +p1=$2 |
| 32 | +p2=$3 |
| 33 | + |
| 34 | +export mediawiki=$target |
| 35 | +export mediawiki_location=$target_dir |
| 36 | + $ScriptLocation/load.sh $target && |
| 37 | + echo "Running checks:" && |
| 38 | + $ScriptLocation/compare_all.sh $p1 $p2 |
Property changes on: trunk/wikiation/wikiation_check_isolation/dl_and_check.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 39 | + |
Index: trunk/wikiation/wikiation_check_isolation/save.sh |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +#!/bin/sh |
| 3 | + |
| 4 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 5 | +# This software is developed by Kim Bruning. |
| 6 | +# |
| 7 | +# Distributed under the terms of the MIT license. |
| 8 | + |
| 9 | + |
| 10 | +if [[ $0 == '/'* ]]; then |
| 11 | + ScriptLocation="`dirname $0`" |
| 12 | +else |
| 13 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 14 | +fi |
| 15 | + |
| 16 | +source ${ScriptLocation}/settings |
| 17 | + |
| 18 | +echo "-- Storing data." |
| 19 | +cd $ScriptLocation |
| 20 | +tarball=${mediawiki}.tar.gz |
| 21 | +tar czf $tarball data |
| 22 | +revisions=$ScriptLocation/revisions |
| 23 | + |
| 24 | +mkdir -p $revisions |
| 25 | +cp $tarball $revisions |
Property changes on: trunk/wikiation/wikiation_check_isolation/save.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 26 | + |
Index: trunk/wikiation/wikiation_check_isolation/load.sh |
— | — | @@ -0,0 +1,22 @@ |
| 2 | +#!/bin/sh |
| 3 | + |
| 4 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 5 | +# This software is developed by Kim Bruning. |
| 6 | +# |
| 7 | +# Distributed under the terms of the MIT license. |
| 8 | + |
| 9 | + |
| 10 | +if [[ $0 == '/'* ]]; then |
| 11 | + ScriptLocation="`dirname $0`" |
| 12 | +else |
| 13 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 14 | +fi |
| 15 | + |
| 16 | +source $ScriptLocation/settings |
| 17 | +revisions=$ScriptLocation/revisions |
| 18 | +tarball=${mediawiki}.tar.gz |
| 19 | +echo "- Obtaining comparison data" |
| 20 | +cp $revisions/$tarball $ScriptLocation |
| 21 | +rm -rf $ScriptLocation/data |
| 22 | +cd $ScriptLocation |
| 23 | +tar xf $ScriptLocation/$tarball |
Property changes on: trunk/wikiation/wikiation_check_isolation/load.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 24 | + |
Index: trunk/wikiation/wikiation_check_isolation/dump_desc.sh |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +#!/bin/sh |
| 3 | +# create a directory describing wiki database (for easy diff-ing) |
| 4 | + |
| 5 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 6 | +# This software is developed by Kim Bruning. |
| 7 | +# |
| 8 | +# Distributed under the terms of the MIT license. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +set -u |
| 13 | +set -e |
| 14 | + |
| 15 | +target_dir=$1 |
| 16 | + |
| 17 | +rm -rf $target_dir |
| 18 | +mkdir -p $target_dir |
| 19 | + |
| 20 | +echo "show tables" | mysql $mediawiki | grep -v Tables_in_$mediawiki > $target_dir/tables |
| 21 | + |
| 22 | +exec < $target_dir/tables |
| 23 | +while read table |
| 24 | +do |
| 25 | + echo "desc $table" | mysql $mediawiki > $target_dir/$table |
| 26 | +done |
Property changes on: trunk/wikiation/wikiation_check_isolation/dump_desc.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 27 | + |
Index: trunk/wikiation/wikiation_check_isolation/README |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 3 | +# This software is developed by Kim Bruning. |
| 4 | +# |
| 5 | +# Distributed under the terms of the MIT license. |
| 6 | + |
| 7 | + |
| 8 | +dl_and_check.sh |
| 9 | +create_and_ul.sh |
| 10 | + |
| 11 | +settings |
| 12 | + |
| 13 | +Quick hack/ Test suite to check Mediawiki, sees which changes have been made to |
| 14 | +mediawiki code, or to the database. Written by Kim Bruning |
| 15 | + |
| 16 | +Currently handles 1 changeset only, this changeset is stored at the |
| 17 | +remote location specified in the settings file. |
| 18 | + |
| 19 | +==create_and_ul.sh== |
| 20 | +<Depreciated gwicke 08/2008: only pull supported> |
| 21 | + |
| 22 | +Creates a new changeset for the specified revision |
| 23 | +will be run from the installer (so you never need to use this!) |
| 24 | + |
| 25 | + |
| 26 | +==dl_and_check.sh [--detail|-d] [exclude]== |
| 27 | +Checks changeset against current mediawiki and database for your revision |
| 28 | +Will report any differences. |
| 29 | + |
| 30 | +If the detail flag is set, will give more detail on mediawiki code comparison |
| 31 | + to wit: |
| 32 | + diff -q (show only whether files differ) is turned off, |
| 33 | + diff -N (assume missing files are empty) is turned on. |
| 34 | + |
| 35 | +Files and directories matching the optional exclude pattern will be ignored. |
| 36 | + |
| 37 | +== settings == |
| 38 | +Deprecated |
| 39 | + |
| 40 | +== Use on 83.149.110.226 or other wikitestservers == |
| 41 | + |
| 42 | +dl_and_check.sh can be called via CheckMWandDBdiff |
| 43 | + |
| 44 | +Should assumptions change, please contact the author. |
| 45 | + |
| 46 | +== Example == |
| 47 | + |
| 48 | +Check |
Index: trunk/wikiation/wikiation_check_isolation/create_and_ul.sh |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +#!/bin/sh |
| 3 | +#save data on a particular revision |
| 4 | + |
| 5 | +# This software, copyright (C) 2008-2009 by Wikiation. |
| 6 | +# This software is developed by Kim Bruning. |
| 7 | +# |
| 8 | +# Distributed under the terms of the MIT license. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +if [[ $0 == '/'* ]]; then |
| 13 | + ScriptLocation="`dirname $0`" |
| 14 | +else |
| 15 | + ScriptLocation="`pwd`"/"`dirname $0`" |
| 16 | +fi |
| 17 | + |
| 18 | +target=$1 |
| 19 | +target_dir="/var/www/revisions/$target"; |
| 20 | +if test ! -e $target_dir; then |
| 21 | + echo "$target not found" |
| 22 | + exit 0 |
| 23 | +fi |
| 24 | + |
| 25 | +echo "- Collecting data." |
| 26 | +export mediawiki=$target |
| 27 | +export mediawiki_location=$target_dir |
| 28 | + $ScriptLocation/create_data.sh && |
| 29 | + $ScriptLocation/save.sh |
| 30 | + |
Property changes on: trunk/wikiation/wikiation_check_isolation/create_and_ul.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 31 | + |