Skip to content

Releases: matteomattei/PySquashfsImage

v0.9.0

02 Jul 23:46
8f4d3dc
Compare
Choose a tag to compare

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

v0.8.0

03 May 16:45
Compare
Choose a tag to compare
  • Formatting, dead code and quick fixes (#20)
  • Use stat.filemode() in getMode() when using Python 3 (#20)
  • All compressors are now a subclass of _Compressor (#21)
  • Use struct (#21)
  • File names and paths are now instances of str (#22)
  • Replace fill by the from_bytes class method (#22)
  • Use argparse for command line parsing (#22)
  • New pysquashfsimage command (#22)
  • Python 2 fixes (#23)
  • Decompressors fixes (#23)
  • Change internal classes names to comply with PEP 8 (#23)

API changes

  • Move towards an API similar to pathlib's (#23)
  • Add is_{file,socket,fifo,block_device,char_device} properties to SquashedFile and SquashInode (#23)
  • SquashedFile.hasAttribute() and SquashInode.hasAttribute() have been removed, use the is_* properties instead (#23)
  • SquashInode.xattr is now a property, SquashInode.getXattr() is deprecated (#23)
  • SquashInode.getContent() is deprecated, use SquashInode.read_bytes() instead (#23)
  • SquashedFile.name is now a property, SquashedFile.getName() is deprecated (#23)
  • SquashedFile.xattr is now a property, SquashedFile.getXattr() is deprecated (#23)
  • Add SquashedFile.path property, SquashedFile.getPath() is deprecated (#23)
  • Add SquashedFile.size property, SquashedFile.getLength() is deprecated (#23)
  • Add SquashedFile.filemode property, SquashedFile.getMode() is deprecated (#23)
  • SquashedFile.findAll() is deprecated, use SquashedFile.find_all() instead (#23)
  • SquashedFile.findAllPaths() is deprecated, use SquashedFile.find_all_paths() instead (#23)
  • SquashedFile.getContent() is deprecated, use SquashedFile.read_bytes() instead (#23)
  • SquashedFile.isFolder() is deprecated, use the SquashedFile.is_dir property instead (#23)
  • SquashedFile.isLink() is deprecated, use the SquashedFile.is_symlink property instead (#23)
  • SquashedFile.getLink() is deprecated, use SquashedFile.readlink() instead (#23)
  • SquashFsImage.root is now a property, SquashFsImage.getRoot() is deprecated (#23)
  • SquashFsImage.setFile() is deprecated, use SquashFsImage.set_file() instead (#23)
  • SquashFsImage.getFileContent() is deprecated, use SquashFsImage.read_file() instead (#23)

The deprecated methods will be removed in a future version.

New Contributors

Full Changelog: v0.7...v0.8.0

v0.7.1

02 May 23:01
Compare
Choose a tag to compare

New Contributors

Full Changelog: v0.6...v0.7

v0.6

11 Oct 13:01
Compare
Choose a tag to compare
  • Fix a few miscellaneous errors (#6) by @RoliSoft
  • Various fixes for Python 2.7 and Python 3.x

Tested with Python 2.7 and Python 3.5.2.

New Contributors

Full Changelog: v0.5...v0.6

v0.5

02 May 21:12
Compare
Choose a tag to compare

Allow file system to start at an offset (#5) by @BotoX.

Full Changelog: v0.4...v0.5

v0.4

02 May 20:58
Compare
Choose a tag to compare
  • Fix wrong implementation of read_fragment_table (#4) by @BotoX
  • Add support for XZ compression (#4) by @BotoX

New Contributors

  • @BotoX made their first contribution in #4

Full Changelog: v0.3...v0.4

v0.3

02 May 19:50
Compare
Choose a tag to compare

Add support for Python 3.

Full Changelog: v0.2...v0.3

v0.2

02 May 19:47
Compare
Choose a tag to compare

Fix license header.

Full Changelog: v0.1...v0.2

v0.1

02 May 17:28
Compare
Choose a tag to compare

First release.