r49064 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49063‎ | r49064 | r49065 >
Date:11:57, 31 March 2009
Author:kim
Status:deferred
Tags:
Comment:
* Improved error reporting from Combined_Installer
* Above found a bug in Scripted_Installer (fixed)
* Also small update to LiquidThreads installer (more reliable)
Modified paths:
  • /trunk/wikiation/installer/combined_installer.py (modified) (history)
  • /trunk/wikiation/installer/extension_installer.py (modified) (history)
  • /trunk/wikiation/installer/installation_system.py (modified) (history)
  • /trunk/wikiation/installer/installers.py (modified) (history)
  • /trunk/wikiation/installer/installfiles/extensions/LiquidThreads.install/setup.sh (modified) (history)
  • /trunk/wikiation/installer/scripted_installer.py (modified) (history)

Diff [purge]

Index: trunk/wikiation/installer/extension_installer.py
@@ -7,7 +7,7 @@
88
99
1010 class Extension_Installer(Installation_System):
11 - system_name='extensions'
 11+ system_name='extensions_generic'
1212 destination_dir=None
1313
1414 def set_instance(self,instance):
Index: trunk/wikiation/installer/scripted_installer.py
@@ -15,6 +15,12 @@
1616
1717
1818 class Scripted_Installer(Extension_Installer):
 19+
 20+ def __init__(self,instance=None):
 21+ Extension_Installer.__init__(self,instance)
 22+ self.subsystemdir=os.path.join(settings.installfiles,"extensions")
 23+
 24+ system_name="scripted"
1925 def install_settings(self, installer_name):
2026 installdir=self.installdir_name(installer_name)
2127 settingsdir=os.path.join(self.destination_dir,"../LocalSettings")
Index: trunk/wikiation/installer/combined_installer.py
@@ -122,13 +122,17 @@
123123
124124 def install(self, installer_name):
125125 """actually install something. Short circuits (Will try each installer, until success"""
 126+ messages=[]
126127 for system in self.systemlist:
127128 try:
128129 if system.install(installer_name):
129130 return True
130 - except: #TODO sometimes an installer may recognise that something CAN NOT be installed, in that case, we should stop trying.
131 - pass
 131+ except Exception,e: #TODO sometimes an installer may recognise that something CAN NOT be installed, in that case, we should stop trying.
 132+ messages.append(system.system_name+": "+e.message)
132133
 134+ if messages:
 135+ raise Combined_Installer_Exception ("\n".join(messages))
 136+
133137 return False
134138
135139 def setup(self, installer_name, destination_dir=None):
@@ -153,8 +157,11 @@
154158 if system.uninstall(installer_name):
155159 return True
156160 except: #TODO sometimes an installer may recognise that something CAN NOT be uninstalled, in that case, we should stop trying
157 - pass
 161+ messages.append(system.system_name+": "+e.message)
158162
 163+ if messages:
 164+ raise Combined_Installer_Exception ("\n".join(messages))
 165+
159166 return False
160167
161168
Index: trunk/wikiation/installer/installfiles/extensions/LiquidThreads.install/setup.sh
@@ -1,3 +1,3 @@
22 #!/bin/sh
33
4 -$MYSQL_COMMAND $DATABASE_NAME < $NAME/lqt.sql
 4+$MYSQL_COMMAND $DATABASE_NAME < $DESTINATION_DIR/$NAME/lqt.sql
Index: trunk/wikiation/installer/installation_system.py
@@ -252,17 +252,16 @@
253253 raise Installer_Exception("Can't find installer "+installer_name)
254254
255255 if self.is_installed(installer_name):
256 - print installer_name,"already installed."
257 - return
258 - try:
259 - self.download(installer_name)
260 - self.install_settings(installer_name)
261 - self.setup(installer_name)
 256+ raise Installer_Exception(installer_name+"already installed.")
 257+ #try:
 258+ self.download(installer_name)
 259+ self.install_settings(installer_name)
 260+ self.setup(installer_name)
262261 # ...
263 - except Installer_Exception:
264 - pass
265 - except:
266 - raise
 262+ #except Installer_Exception:
 263+ # pass
 264+ #except:
 265+ # raise
267266
268267 #query the installer to see if ot thinks the component is properly installed
269268 # any flaws at this point are the fault of the installer :-P
Index: trunk/wikiation/installer/installers.py
@@ -189,7 +189,6 @@
190190
191191 except Installer_Exception,e:
192192 print e.message
193 - return
194193
195194
196195 def uninstall(args):

Status & tagging log