def finish(self):
<EOL>self.write_header()<EOL>self.write_index()<EOL>if not self.use_old_format:<EOL><INDENT>sigs = self.calculate_signatures()<EOL>self.write_signatures(sigs)<EOL><DEDENT>
Finalize the MAR file.

        The MAR header, index and signatures need to be updated once we've
        finished adding all the files.