Age | Commit message (Collapse) | Author |
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
There is no need to keep a copy of the state data internally. If the
external user wants to reset/rewind, they can simply keep a copy of
the old state, now that it is completely transparent.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of holding the state internally, move it outside and let the
user pass it in. This allows processing multiple directories and going
back and forth between them, while also simplifying the dir reader
internals.
The sqfs_dir_reader_get_inode function can also be made more generic
to accept a reference instead of being fully state dependent.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Those functions are only used in the example code, we remove them for
now to make restructuring easier and fix the examples later.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The only user in the code base is sqfs_dir_reader_find_by_path.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Modify gensquashfs to pack data using an istream wrapper, similar
to tar2sqfs. To implement the no-tail-pack option, we need the file
size, so we simply open a raw handle first, and query it (using
libsquashfs API) and then create the stream wrapper. For the output
side, we create a block-processor ostream wrapper and splice it.
Since gensquashfs is the only, remaining user of the pack-a-file
functon, we can then remove it from libcommon.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
On platforms like Windows, we don't have fnmatch.h and a libcompat
implementation is provided. Instead of including fnmatch.h, include
compat.h which includes the propper headers, if available.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Always set the reference count to 1 after creating a copy
of an object.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The new behavior is enabled by default (except on Windows) and needs
to be turned off explicitly.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The reason this is implemented separately, instead of roling it into
the recursive iterator, is so that we can do additional filtering
in between. For instance, we can rewrite the path and the hard link
path will match up, or if we remove nodes from the hierarchy, we
won't end up with a hard link pointing outside.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Rename the open function to sqfs_file_open, use an argument for the
return pointer and pass back and error number on failure. Also add
an inermediate function to open an sqfs_file_t using a handle, similar
to the stream API. The get_file_size function is moved to the native
wrappers and some of the implementation is cleaned up a little.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
If we glob a directory, the generated entries can be added to a
virtual sub directory, that does not corespond to the original layout.
If we try to use those virtual paths for packing files, it will fail,
so we need to remove that prefix to reconstruct the original path.
Second, the glob operation allows us to select a sub-directory of the
pack-dir. This prefix-path is stripped away when scanning the entries.
We need to add it back to get the original, pack-dir relative file
paths.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
This might be needed externally for things like hard link detection.
For the unix implementation, store the actual inode number here.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
To the sqfs_data_reader_t is added, an sqfs_istream_t implementation
that internally reads through the data reader. The uses of the
data_reader_dump function are removed and the function is subsequently
removed from libcommon.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The recursive part and the filter part are split up, the recursive
iterator wrapper is moved into libsquashfs and the libio iterator
is modified to use that internally instead of implementig the
recursion step.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Using --exclude or -E it is now possible to exclude
files from the input tar stream.
The options can be used multiple times.
Signed-off-by: Richard Weinberger <richard@nod.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Exact operation performed:
git ls-files -z | \
xargs -0 sed -i -e 's/dir_entry_t/sqfs_dir_entry_t/g
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Exact operation performed:
git ls-files -z | \
xargs -0 sed -i -e 's/sqfs_dir_entry_t/sqfs_dir_node_t/g'
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
There are several ad-hoc int/uint parsers scattered around the code,
add a single helper function for that task and replace the multiple
instances. A simple white-box test case is added for the utility
function.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Make use of the helpers in libutil
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Allow spaces between `-type` and the character, look it up
from a table instead of having `-type <char>` pairs in the
main table.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|