This is a tree implementation with elements with primary and secondary
key. The code is a cleaned up version of ramfs's implementation. ramfs
doesn't use this version yet.
* Don't only look up the entry attribute when the entry is implicit.
Look it up, when it is a directory instead. This aligns it the logic
with _UpdateCheckEntryCollisions().
* When the entry attribute exits and the entry is not implicit, add file
attributes, but not stat data. This also aligns the logic with
_UpdateCheckEntryCollisions(), which removes colliding attributes, but
keeps stat data.
Add flags parameter to BPackageWriter::Init() (and the private
implementation classes) to indicate that an existing package file shall
be updated instead of created. Currently that always happens in-place.
When compression doesn't save space, using it nonetheless results in a
file that the reader complains about. So we fall back to writing an
uncompressed package attributes section in such a case.
The same still needs to be done for the TOC section.
* Add hooks HandleSectionStart() and HandleSectionEnd(). They are
invoked to bracket package file section, so the handler can
discriminate which section the attributes belong to.
HandleSectionStart() features a return parameter _handleSection, which
allows to handler to pick which sections it wants to handle.
* "package dump" does now print the section names.
If a FD is specified, instead of using the file with the given the FD is
used. Allows for adding entries without first copying them into the
directory structure.
This makes opening symlinks work universally in the build system tools.
Two mechanisms have been implemented, both of which don't always work.
The first is remapping via preprocessor macros. This fails where equally
named methods are used (e.g. STL fstream::open()). The other is using
hidden functions in the new libroot_build_function_remapper.a that is
linked into everything that is linked against libroot_build.so. This one
fails for functions that are defined inline in headers (Linux/glibc does
that). Together they seem to cover our build system needs ATM.
In HandleEntry() create the file/directory with sufficient permissions
for the user and set the archived permissions in HandleEntryDone(). This
makes sure child attributes and entries can be created.
* Match the attribute in a loop, use an attribute ID switch, do the
"seen" checks without the switch.
* Explicitly handle the case when encountering an unknown attribute.