Releases: matteomattei/PySquashfsImage
Releases · matteomattei/PySquashfsImage
v0.9.0
This version drops support for Python 2.6 and 3.0.
Breaking changes
- Remove previously deprecated methods
- Replace
SquashInodeandSquashedFileby one class per inode/file type with different attributes and methods - Remove some
SquashFsImageattributes:fragment_buffer_size,data_buffer_size,block_size,block_log,all_buffers_size,inode_table,created_inode,total_blocks,total_files,total_inodes,directory_tableandinode_to_file. Some were or are now unused, others were simply shortcuts to attributes of the superblock - Rename
SquashFsImage.sBlktoSquashFsImage.sblkand make it a property - Rename
SquashFsImage.image_filetoSquashFsImage._fd - All remaining
SquashFsImageattributes are made "private" - Root directory's path is now a single slash
- Package layout changes
- Rename command line utility from
pysquashfsimagetopysquashfs - Change
SquashFsImageconstructor. The signature is nowSquashFsImage(fd, offset=0, closefd=True). Calls toSquashFsImage("/path/to/file", offset=n)must be replaced bySquashFsImage.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 ofFile SquashFsImageinstances can be used as context managers- Instances of
Directoryemulate a read-only mapping and have 2 new methodsriter()andfind() - Instances of
RegularFilehave 3 methodsiter_bytes(),read_bytes()andread_text() - Iterating over an instance of
SquashFsImagewill yield all its files recursively as if usingroot.riter()
Other changes
- Add
SquashFsImage.from_bytes(),SquashFsImage.find()andSquashFsImage.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.sizeproperty - Add
find_superblocks() - Add support for calling
dict()on structures (instances ofstructure._Base) - New CLI with 3 subcommands
Full Changelog: v0.8.0...v0.9.0
v0.8.0
- Formatting, dead code and quick fixes (#20)
- Use
stat.filemode()ingetMode()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
fillby thefrom_bytesclass method (#22) - Use
argparsefor command line parsing (#22) - New
pysquashfsimagecommand (#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 toSquashedFileandSquashInode(#23) SquashedFile.hasAttribute()andSquashInode.hasAttribute()have been removed, use theis_*properties instead (#23)SquashInode.xattris now a property,SquashInode.getXattr()is deprecated (#23)SquashInode.getContent()is deprecated, useSquashInode.read_bytes()instead (#23)SquashedFile.nameis now a property,SquashedFile.getName()is deprecated (#23)SquashedFile.xattris now a property,SquashedFile.getXattr()is deprecated (#23)- Add
SquashedFile.pathproperty,SquashedFile.getPath()is deprecated (#23) - Add
SquashedFile.sizeproperty,SquashedFile.getLength()is deprecated (#23) - Add
SquashedFile.filemodeproperty,SquashedFile.getMode()is deprecated (#23) SquashedFile.findAll()is deprecated, useSquashedFile.find_all()instead (#23)SquashedFile.findAllPaths()is deprecated, useSquashedFile.find_all_paths()instead (#23)SquashedFile.getContent()is deprecated, useSquashedFile.read_bytes()instead (#23)SquashedFile.isFolder()is deprecated, use theSquashedFile.is_dirproperty instead (#23)SquashedFile.isLink()is deprecated, use theSquashedFile.is_symlinkproperty instead (#23)SquashedFile.getLink()is deprecated, useSquashedFile.readlink()instead (#23)SquashFsImage.rootis now a property,SquashFsImage.getRoot()is deprecated (#23)SquashFsImage.setFile()is deprecated, useSquashFsImage.set_file()instead (#23)SquashFsImage.getFileContent()is deprecated, useSquashFsImage.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
- Add support for LZ4 compression (#9) by @charles-dyfis-net
- Avoid calling
importeach time we calluncompress()(#9) by @charles-dyfis-net - Only load decompressors when needed (#9) by @charles-dyfis-net
- Fix xattrs loading (#8) by @Dr-Emann
- Use
int.from_bytes()with Python 3 (#10) by @nigels-com - Add support for symlinks (#11) by @nigels-com
- Fix
select()to work with Python 3 (#12) by @nigels-com - Add
getMode()to get an ls-style string for file type and permissions (#12) by @nigels-com - Add reference links (#13) by @nigels-com
- Update
getMode()to also show SUID and SGID (#14) by @nigels-com - Fix processing of SQUASHFS_LREG_TYPE entries (#15) by @darktemplarbasealt
- Add
getXattr()methods (#17) by @franksinankaya - Add support for Zstandard compression (#18) by @shashank956
- Replace compressors list with dictionary (#19) by @shashank956
New Contributors
- @charles-dyfis-net made their first contribution in #9
- @Dr-Emann made their first contribution in #8
- @nigels-com made their first contribution in #10
- @darktemplarbasealt made their first contribution in #15
- @franksinankaya made their first contribution in #17
- @shashank956 made their first contribution in #18
Full Changelog: v0.6...v0.7
v0.6
v0.5
v0.4
v0.3
Add support for Python 3.
Full Changelog: v0.2...v0.3
v0.2
Fix license header.
Full Changelog: v0.1...v0.2