From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1H3Jj5-00062y-IZ for garchives@archives.gentoo.org; Sat, 06 Jan 2007 22:09:20 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.8) with SMTP id l06M75up005102; Sat, 6 Jan 2007 22:07:05 GMT Received: from s15216962.onlinehome-server.info (s15216962.onlinehome-server.info [217.160.22.205]) by robin.gentoo.org (8.13.8/8.13.8) with ESMTP id l06M4gsp000601 for ; Sat, 6 Jan 2007 22:04:47 GMT Received: (from uucp@localhost) by s15216962.onlinehome-server.info (8.13.3/8.13.3/SuSE Linux 0.7) with UUCP id l06LNVfn022383 for gentoo-user@lists.gentoo.org; Sat, 6 Jan 2007 22:23:31 +0100 Received: (from weigelt@localhost) by nibiru.metux.de (8.12.10/8.12.10) id l06LKLtD023806 for gentoo-user@lists.gentoo.org; Sat, 6 Jan 2007 22:20:21 +0100 Date: Sat, 6 Jan 2007 22:20:21 +0100 From: Enrico Weigelt To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Problem upgrading mediawiki Message-ID: <20070106212021.GD20396@nibiru.local> References: <20061231172041.GA24330@nibiru.local> <4598CCC5.2090908@armispiansystems.ca> <20070101174852.GA22582@nibiru.local> <459A7AB8.8060008@badapple.net> <20070105203521.GD22582@nibiru.local> <20070105214059.GA31944@nibiru.local> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline In-Reply-To: <20070105214059.GA31944@nibiru.local> User-Agent: Mutt/1.4.1i X-Terror: bin laden, kill bush, Briefbombe, Massenvernichtung, KZ, X-Nazi: Weisse Rasse, Hitlers Wiederauferstehung, 42, X-Antichrist: weg mit schaeuble, ausrotten, heiliger krieg, al quaida, X-Killer: 23, endloesung, Weltuntergang, X-Doof: wer das liest ist doof X-Archives-Salt: 4a6dfd08-9e1a-4149-ae52-b8eaa9fbb6be X-Archives-Hash: 40fb396d7dd3cd0f5f89dec360988cc3 --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Okay folks, here's a little script for assisting wiki updates. It does not yet fix the database permissions, since I'm not yet shure how I like to pass the superuser login/passwd. (suggestions welcomed) cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT service - http://www.metux.de/ --------------------------------------------------------------------- Please visit the OpenSource QM Taskforce: http://wiki.metux.de/public/OpenSource_QM_Taskforce Patches / Fixes for a lot dozens of packages in dozens of versions: http://patches.metux.de/ --------------------------------------------------------------------- --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=update-wiki #!/usr/bin/php // // This script may be redistributed under the terms of the GPL. // $WEBAPP="mediawiki"; $DBSUPERUSER_NAME="root"; $DBSUPERUSER_PASSWORD="pemnj92"; if (!$_SERVER{'argv'}[2]) die ("update-wiki: "); $HOSTNAME=$_SERVER{'argv'}[1]; $VERSION=$_SERVER{'argv'}[2]; $WWWROOT="/var/www/$HOSTNAME/htdocs"; $MNTDIR="$WWWROOT/maintenance/"; $LOCALSETTINGS="$WWWROOT/LocalSettings.php"; $ADMINSETTINGS="$WWWROOT/AdminSettings.php"; if (!@fopen($LOCALSETTINGS,"r")) die ( "missing LocalSettings.php - you have to configure it first" ); if (!@fopen($ADMINSETTINGS,"r")) { echo "missing AdminSettings.php ... creating it\n"; define('MEDIAWIKI',1); require_once($LOCALSETTINGS); $fp_in=fopen($LOCALSETTINGS,"r"); $fp_out=fopen($ADMINSETTINGS,"w"); while (!feof($fp_in)) { $line=fgets($fp_in,4096); if (trim($line)=='?>') { fputs($fp_out,'$wgDBadminuser="'.$wgDBuser."\";\n"); fputs($fp_out,'$wgDBadminpassword="'.$wgDBpassword."\";\n"); fputs($fp_out,"\n"); fputs($fp_out,$line); while (!feof($fp_in)) fputs($fp_out,fgets($fp_in,4096)); $gotend = true; } else fputs($fp_out,$line); } if (!$gotend) { fputs($fp_out,'$wgDBadminuser="'.$wgDBuser."\";\n"); fputs($fp_out,'$wgDBadminpassword="'.$wgDBpassword."\";\n"); } fclose($fp_in); fclose($fp_out); } print "Upgrading the webapp code (->webapp-config)\n"; if (passthru("webapp-config -U -h $HOSTNAME $WEBAPP $VERSION",$ret)||($ret==0)) print "Okay\n"; else die ( "webapp-config failed: $ret\n"); print "Now calling the update script\n"; print "If it cannot do certain structure changes (ie. creating tables),\n"; print "you have to give full db access to the wiki user\n"; print "\n"; if (passthru("cd $MNTDIR && php update.php",$res)||($res==0)) print "OKAY\n"; else die("ERROR\n"); --PEIAKu/WMn1b1Hv9-- -- gentoo-user@gentoo.org mailing list