Paul Moore <p.f.moore <at> gmail.com> writes: > A nice addition would be an API for managing the RECORD file. I would > imagine functions to read/write the file (hiding the details of how to > open the CSV file correctly in a cross-platform manner), functions to > produce a list of the files installed for a distribution, and > functions to validate (and maybe write) the hashes. >
Producing the list of files installed for a distribution might be tool-specific (e.g. a tool might have additional tool-specific files over and above what any PEPs mandate). There's a method in database.py - Distribution.list_installed_files() - which reads and returns the RECORD entries as (path, hash, size) tuples. I think all that's needed (at the same level of abstraction) is a method write_installed_files(iterable_of_absolute_file_paths) which writes the file. This code is already in the distutils2.install_distinfo.install_distinfo.run() method. I'll pull it out into such a method. Anyone else, do chip in if you think this is insufficient or sub-optimal. Perhaps these discussions (on the detail) should continue on distutils-sig. I'll post there when I've made the changes. Regards, Vinay Sajip _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com