# HG changeset patch # User Sylvain Thénault # Date 1276879757 -7200 # Node ID 351e84e18a6136e4277e501525f5b6b970807e85 # Parent 1faff41593df558be4fd5f0646b4a80729d7c6a9 closes #1059729: cw-ctl upgrade : i18n upgrade not performed if DB does not need upgrade diff -r 1faff41593df -r 351e84e18a61 cwctl.py --- a/cwctl.py Fri Jun 18 18:14:55 2010 +0200 +++ b/cwctl.py Fri Jun 18 18:49:17 2010 +0200 @@ -731,7 +731,9 @@ if cubicwebversion > applcubicwebversion: toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion)) if not self.config.fs_only and not toupgrade: - print '-> no software migration needed for instance %s.' % appid + print '-> no data migration needed for instance %s.' % appid + self.i18nupgrade(config) + mih.shutdown() return for cube, fromversion, toversion in toupgrade: print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube) @@ -742,6 +744,22 @@ mih.migrate(vcconf, reversed(toupgrade), self.config) # rewrite main configuration file mih.rewrite_configuration() + mih.shutdown() + # handle i18n upgrade + if not self.i18nupgrade(config): + return + print + print '-> instance migrated.' + if not (CWDEV or self.config.nostartstop): + # restart instance through fork to get a proper environment, avoid + # uicfg pb (and probably gettext catalogs, to check...) + forkcmd = '%s start %s' % (sys.argv[0], appid) + status = system(forkcmd) + if status: + print '%s exited with status %s' % (forkcmd, status) + print + + def i18nupgrade(self, config): # handle i18n upgrade: # * install new languages # * recompile catalogs @@ -753,21 +771,10 @@ if errors: print '\n'.join(errors) if not ASK.confirm('Error while compiling message catalogs, ' - 'continue anyway ?'): + 'continue anyway?'): print '-> migration not completed.' - return - mih.shutdown() - print - print '-> instance migrated.' - if not (CWDEV or self.config.nostartstop): - # restart instance through fork to get a proper environment, avoid - # uicfg pb (and probably gettext catalogs, to check...) - forkcmd = '%s start %s' % (sys.argv[0], appid) - status = system(forkcmd) - if status: - print '%s exited with status %s' % (forkcmd, status) - print - + return False + return True class ShellCommand(Command): """Run an interactive migration shell on an instance. This is a python shell