Skip to content

v0.9.0

Latest
Compare
Choose a tag to compare
@AT0myks AT0myks released this 02 Jul 23:46
· 1 commit to master since this release
8f4d3dc

This version drops support for Python 2.6 and 3.0.

Breaking changes

  • Remove previously deprecated methods
  • Replace SquashInode and SquashedFile by one class per inode/file type with different attributes and methods
  • Remove some SquashFsImage attributes: fragment_buffer_size, data_buffer_size, block_size, block_log, all_buffers_size, inode_table, created_inode, total_blocks, total_files, total_inodes, directory_table and inode_to_file. Some were or are now unused, others were simply shortcuts to attributes of the superblock
  • Rename SquashFsImage.sBlk to SquashFsImage.sblk and make it a property
  • Rename SquashFsImage.image_file to SquashFsImage._fd
  • All remaining SquashFsImage attributes are made "private"
  • Root directory's path is now a single slash
  • Package layout changes
  • Rename command line utility from pysquashfsimage to pysquashfs
  • Change SquashFsImage constructor. The signature is now SquashFsImage(fd, offset=0, closefd=True). Calls to SquashFsImage("/path/to/file", offset=n) must be replaced by SquashFsImage.from_file("/path/to/file", offset=n)
  • Remove SquashFsImage.set_file(). Use the constructor instead

New API

The most notable changes are:

  • Instead of being instances of SquashedFile, all files are now instances of a subclass of File
  • SquashFsImage instances can be used as context managers
  • Instances of Directory emulate a read-only mapping and have 2 new methods riter() and find()
  • Instances of RegularFile have 3 methods iter_bytes(), read_bytes() and read_text()
  • Iterating over an instance of SquashFsImage will yield all its files recursively as if using root.riter()

Other changes

  • Add SquashFsImage.from_bytes(), SquashFsImage.find() and SquashFsImage.select()
  • All file types are now "scanned", not just directories, regular files and symlinks
  • All struct-based classes are now ctypes-based
  • Add support for LZO compression
  • Add support for holes
  • Reading large files is a lot faster
  • Add functions for image extraction (extended attributes not supported yet)
  • Add LRU cache for Python 3.2+ which can greatly speed up file reads in certain conditions
  • Add SquashFsImage.size property
  • Add find_superblocks()
  • Add support for calling dict() on structures (instances of structure._Base)
  • New CLI with 3 subcommands

Full Changelog: v0.8.0...v0.9.0