From f1a8b2ea724129fc4a3c2763e8af4e9309b15a9b Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 13 Aug 2012 21:53:52 -0700 Subject: [PATCH] FML will skip gathering MD5s for classes in the cpw package during the the inital recompile {Make Side/SideOnly reobf properly} --- fml/commands.patch | 29 ++++++++++++++++++----------- fml/install/fml.py | 15 ++++++++++++--- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/fml/commands.patch b/fml/commands.patch index 88797a29c..ec49a6933 100644 --- a/fml/commands.patch +++ b/fml/commands.patch @@ -154,7 +154,7 @@ fields[row['searge']] = row['desc'].replace('*/', '* /') regexps = { -@@ -1420,6 +1452,7 @@ +@@ -1420,12 +1452,13 @@ # HINT: We create the list of source directories based on the list of packages pkglist = filterdirs(pathsrclk[side], '*.java', append_pattern=True) @@ -162,16 +162,23 @@ dirs = ' '.join(pkglist) forkcmd = self.cmdastyle.format(classes=dirs, conffile=self.astyleconf) self.runcmd(forkcmd) -@@ -1526,6 +1559,9 @@ - trgclasses.append(key) - self.logger.info('> Unchanged class found: %s', key) - classes = {} -+ for key in [ 'cpw/mods/fml/common/asm/SideOnly', 'cpw/mods/fml/common/Side' ]: -+ self.logger.info('> Forcing FML class: %s', key) -+ trgclasses.append(key) - srg_data = parse_srg(srglk[side]) - for row in srg_data['CL']: - classes[row['deobf_name']] = row['obf_name'] + return True + +- def gathermd5s(self, side, reobf=False): ++ def gathermd5s(self, side, reobf=False, skip_fml=False): + if not reobf: + md5lk = {CLIENT: self.md5client, SERVER: self.md5server} + else: +@@ -1440,6 +1473,9 @@ + class_path = '' + else: + class_path += '/' ++ if skip_fml: ++ if class_path.startswith('cpw/'): ++ continue + for class_file in fnmatch.filter(filelist, '*.class'): + class_name = class_path + os.path.splitext(class_file)[0] + bin_file = os.path.normpath(os.path.join(path, class_file)) @@ -1592,6 +1628,9 @@ sys.exit(1) diff --git a/fml/install/fml.py b/fml/install/fml.py index d81fc61d1..6dfe38843 100644 --- a/fml/install/fml.py +++ b/fml/install/fml.py @@ -157,7 +157,6 @@ def setup_fml(fml_dir, mcp_dir): from runtime.decompile import decompile from runtime.cleanup import cleanup from runtime.commands import Commands, CLIENT, SERVER - from runtime.mcp import decompile_side, updatemd5_side src_dir = os.path.join(mcp_dir, 'src') @@ -265,12 +264,22 @@ def setup_fml(fml_dir, mcp_dir): os.chdir(mcp_dir) commands = Commands(verify=True) - updatemd5_side(commands, CLIENT) - updatemd5_side(commands, SERVER) + updatemd5_side(mcp_dir, commands, CLIENT) + updatemd5_side(mcp_dir, commands, SERVER) reset_logger() os.chdir(fml_dir) +def updatemd5_side(mcp_dir, commands, side): + sys.path.append(mcp_dir) + from runtime.mcp import recompile_side, updatemd5_side + from runtime.commands import SIDE_NAME + + recomp = recompile_side(commands, side) + if recomp: + commands.logger.info('> Generating %s md5s', SIDE_NAME[side]) + commands.gathermd5s(side, skip_fml=True) + def cmdsplit(args): if os.sep == '\\': args = args.replace('\\', '\\\\')