Bug 726656 - fix optimizejars.py to optimize omni.ja; r=khuey

This commit is contained in:
Nathan Froyd 2012-02-16 06:31:49 -08:00
parent cf6d87f9ba
commit f608a2b3c2

View File

@ -35,7 +35,7 @@
#
# ***** END LICENSE BLOCK *****
import sys, os, subprocess, struct
import sys, os, subprocess, struct, re
local_file_header = [
("signature", "uint32"),
@ -329,10 +329,12 @@ if len(sys.argv) != 5:
print "Usage: --optimize|--deoptimize %s JAR_LOG_DIR IN_JAR_DIR OUT_JAR_DIR" % sys.argv[0]
exit(1)
jar_regex = re.compile("\\.jar?$")
def optimize(JAR_LOG_DIR, IN_JAR_DIR, OUT_JAR_DIR):
ls = os.listdir(IN_JAR_DIR)
for jarfile in ls:
if not jarfile.endswith(".jar"):
if not re.search(jar_regex, jarfile):
continue
injarfile = os.path.join(IN_JAR_DIR, jarfile)
outjarfile = os.path.join(OUT_JAR_DIR, jarfile)
@ -347,7 +349,7 @@ def deoptimize(JAR_LOG_DIR, IN_JAR_DIR, OUT_JAR_DIR):
ls = os.listdir(IN_JAR_DIR)
for jarfile in ls:
if not jarfile.endswith(".jar"):
if not re.search(jar_regex, jarfile):
continue
injarfile = os.path.join(IN_JAR_DIR, jarfile)
outjarfile = os.path.join(OUT_JAR_DIR, jarfile)