def help(): strHelp = 'make_patch.py [ package | rebuild | init | uninited ]\n' strHelp += ' 1. [package], can skip\n\tPackage next build\n' strHelp += ' 2. rebuild\n\tPackage with current buildNumber\n' strHelp += ' 3. init\n\tRun it before package, initiate some important infomation\n' strHelp += ' 4. uninited\n\tCheck ini files and list results' func.tip(strHelp, '32');
def rebuildPackage(): cfgPsr = ConfigParser.ConfigParser(); cfgPsr.read(gv.BUILD_INI_FILE) last = cfgPsr.get(gv.BUILD_INI_SEC, gv.CURRENT_BUILDNUM) if last == '0': func.tip('\033[40;32m Current build 0, can not rollback') else: cfgPsr.remove_option(gv.BUILD_INI_SEC, 'build'+last) last = str(int(last) - 1) revision = cfgPsr.get(gv.BUILD_INI_SEC, 'build'+last) cfgPsr.set(gv.BUILD_INI_SEC, gv.CURRENT_REVISION, revision) cfgPsr.set(gv.BUILD_INI_SEC, gv.CURRENT_BUILDNUM, last) cfgPsr.write(open(gv.BUILD_INI_FILE, 'w')) packageMain()
def packageMain(): func.tip('>>>> Start To Package build <<<<', '33'); func.tip('-------------------------------------'); func.tip('>>>> START to Check Uninited <<<<', '33'); check.checkUninited(); func.tip('>>>> No Uninitialized Sections <<<<', '33'); func.tip('-------------------------------------'); func.tip('>>>> START to Update Code <<<<', '33'); update.updateSvnCode(); func.tip('>>>> Update code on local <<<<', '33'); func.tip('-------------------------------------'); func.tip('>>>> Start to diff files <<<<', '33'); diff.updateDifflist() func.tip('>>>> Get Different List <<<<', '33'); func.tip('-------------------------------------'); func.tip('>>>> Start to Update Inis <<<<', '33'); config.generateCfgIni() func.tip('>>>> Get Latest Ini Config <<<<', '33'); func.tip('-------------------------------------'); func.tip('>>>> Start to Check Inis <<<<', '33'); check.checkCfgIni() func.tip('>>>> All Check Ini Finished <<<<', '33'); func.tip('-------------------------------------'); func.tip('>>>> Start to Gen package <<<<', '33'); package.package(); func.tip('>>>> Create New Package <<<<', '33'); func.tip('-------------------------------------');