Age | Commit message (Collapse) | Author |
|
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>
|
|
Start with a common prefix "sqfs_native_file_*"
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
It is mainly a very thin wrapper on top of the block processor so far.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
By adding additional close/duplicate primitives, the remaining, mostly
identical istream/ostream/file code is mostly identical between Windows
and Unix and be merged, mostly without stitches.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
On Unix like OSes, this saves/restores errno, on Windows both errno
and GetLastError state are saved/restored.
This should make it simpler to preserve that across function calls.
Additionally, while tracking down uses of GetLastError, some places
where the error code was printed out directly where replaced with
instances of w32_perror.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
- The ostream creation functions already have flag arguments,
but make them an sqfs_u32 instead of int.
- Add flag arguments to the istream functions, sanitzie and forward
them when opening the handle.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
When dropping the parent iterator, update the state _first_.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|