def update_md5(filenames):
import re<EOL>for name in filenames:<EOL><INDENT>base = os.path.basename(name)<EOL>f = open(name,'<STR_LIT:rb>')<EOL>md5_data[base] = md5(f.read()).hexdigest()<EOL>f.close()<EOL><DEDENT>data = ["<STR_LIT>" % it for it in list(md5_data.items())]<EOL>data.sort()<EOL>repl = "<STR_LIT>".join(data)<EOL>import inspect<EOL>srcfile = inspect.getsourcefile(sys.modules[__name__])<EOL>f = open(srcfile, '<STR_LIT:rb>'); src = f.read(); f.close()<EOL>match = re.search("<STR_LIT>", src)<EOL>if not match:<EOL><INDENT>print("<STR_LIT>", file=sys.stderr)<EOL>sys.exit(<NUM_LIT:2>)<EOL><DEDENT>src = src[:match.start(<NUM_LIT:1>)] + repl + src[match.end(<NUM_LIT:1>):]<EOL>f = open(srcfile,'<STR_LIT:w>')<EOL>f.write(src)<EOL>f.close()<EOL>
Update our built-in md5 registry