Commit Graph

41233 Commits

Author SHA1 Message Date
Ingo Weinhold
ec59ac7515 Add a global node listener mechanism 2011-11-25 06:19:06 +01:00
Ingo Weinhold
856c114ca0 Add TwoKeyAVLTree to kernel utils
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.
2011-11-25 06:19:05 +01:00
Ingo Weinhold
9d698c4573 Create a generalized version of BFS's query code
The new version is templatized over a QueryPolicy which provides the
interface to the file system specifics.
2011-11-25 06:19:05 +01:00
Ingo Weinhold
239ce182ab Fix loading the resolvable compatible version 2011-11-25 06:19:04 +01:00
Ingo Weinhold
7e0f4e5703 Fix Dependency version comparisons 2011-11-25 06:19:04 +01:00
Ingo Weinhold
e7c648e06d PackageWriterImpl::_AddEntry(): Fix update logic
* 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.
2011-11-25 06:19:03 +01:00
Ingo Weinhold
420a5c3e42 Remove copy'n'paste left-over 2011-11-25 06:19:02 +01:00
Ingo Weinhold
4d63965914 Fix "package add" heap compacting
PackageWriterImpl::_CompactHeap(): Incorrectly used fHeapEnd instead of
the heap size. So the last copied chunk was too large.
2011-11-25 06:19:02 +01:00
Ingo Weinhold
f4417e14fa PackageWriterImpl::_MoveHeapChunk(): better output 2011-11-25 06:19:01 +01:00
Ingo Weinhold
8ffba2a6cb Write uncompressed package file TOC, if necessary 2011-11-25 06:19:00 +01:00
Ingo Weinhold
2fac6eaa60 Add "package add" command. 2011-11-25 06:19:00 +01:00
Ingo Weinhold
723336fe52 Move directory iteration helper to own file 2011-11-25 06:18:59 +01:00
Ingo Weinhold
cba1e22376 Move PackageWriterListener to separate file 2011-11-25 06:18:59 +01:00
Ingo Weinhold
00bc8e9cbd Add support for adding/updating package entries
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.
2011-11-25 06:18:58 +01:00
Ingo Weinhold
de9e64b235 Write uncompressed package attributes if necessary
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.
2011-11-25 06:18:57 +01:00
Ingo Weinhold
443be501c0 Use fHeapOffset instead of sizeof(hpkg_header) 2011-11-25 06:18:57 +01:00
Ingo Weinhold
e6ebdaaf21 Move RegisterPackageInfo() to Finish() 2011-11-25 06:18:56 +01:00
Ingo Weinhold
5bb68d85fc Add PackageReaderImpl heapOffset/Size getters 2011-11-25 06:18:56 +01:00
Ingo Weinhold
78811461b1 Add BLowLevelPackageContentHandler section hooks
* 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.
2011-11-25 06:18:55 +01:00
Ingo Weinhold
f9caa05c2a Define IDs for package section 2011-11-25 06:18:55 +01:00
Ingo Weinhold
1dd17fa77f Add Array.h and RangeArray.h build headers 2011-11-25 06:18:54 +01:00
Ingo Weinhold
29d45d5ee7 Add RangeArray utility class
Templatized class for managing a set of sorted non-overlapping integer
ranges. Merges and splits ranges as necessary.
2011-11-25 06:18:53 +01:00
Ingo Weinhold
26589141fc Declare Array destructor inline 2011-11-25 06:18:53 +01:00
Ingo Weinhold
9395c27062 Move Debugger's Array class to headers/shared 2011-11-25 06:18:52 +01:00
Ingo Weinhold
b6d9fe9a6b PackageWriterImpl::_AddEntry(): Improve output
Print the relative path instead of only the leaf name.
2011-11-25 06:18:52 +01:00
Ingo Weinhold
8524dd3660 SubPathAdder: Check for overflows, omit initial / 2011-11-25 06:18:51 +01:00
Ingo Weinhold
2fce201893 BLowLevelPackageContentHandler interface extension
HandleAttributeDone(): Add parentToken parameter.
2011-11-25 06:18:50 +01:00
Ingo Weinhold
37880dd0a7 Remove debug output 2011-11-25 06:18:49 +01:00
Ingo Weinhold
d06e885aaf Print relative paths in error messages 2011-11-25 06:18:48 +01:00
Ingo Weinhold
37d971d3cc Support for extracting only specified entries 2011-11-25 06:18:48 +01:00
Ingo Weinhold
376bc55c27 Missing include 2011-11-25 06:18:47 +01:00
Ingo Weinhold
006056b7ee Add package extract -i option
Allows to specify an alternate location for the .PackageInfo.
2011-11-25 06:18:47 +01:00
Ingo Weinhold
93fc03aa52 Remove debug output 2011-11-25 06:18:46 +01:00
Ingo Weinhold
7395bf8a76 Add create -i option for specifying a package info 2011-11-25 06:18:45 +01:00
Ingo Weinhold
0f9a98a419 Add optional FD parameter to AddEntry()
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.
2011-11-25 06:18:45 +01:00
Ingo Weinhold
cd8f03a8cc BPackageInfo::ReadFromConfigFile() BFile& version 2011-11-25 06:18:44 +01:00
Ingo Weinhold
d046296e85 Improve FileDescriptorCloser
* Add SetTo()/Unset() methods and no-argument constructor.
* Detach() returns the FD now.
2011-11-25 06:18:44 +01:00
Ingo Weinhold
efb6462777 Cleanup 2011-11-25 06:18:43 +01:00
Ingo Weinhold
b07fd63144 Add missing "cache" shine-through directory 2011-11-25 06:18:43 +01:00
Ingo Weinhold
85e13d1ef8 Remove the build platform work-arounds 2011-11-25 06:18:42 +01:00
Ingo Weinhold
02982802e6 Disable function remapping via macros
STL fstream::open() is used, so the macros break the build.
2011-11-25 06:18:41 +01:00
Ingo Weinhold
55bc371993 Wrap POSIX FD functions in libroot_build
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.
2011-11-25 06:18:41 +01:00
Ingo Weinhold
0fbcad54be Add helper is_unknown_or_system_descriptor() 2011-11-25 06:18:40 +01:00
Ingo Weinhold
640b4ed97d _kern_read_link() ignored the path 2011-11-25 06:18:40 +01:00
Ingo Weinhold
c29492a252 Fix gcc 2 build by making Parser a friend 2011-11-25 06:18:39 +01:00
Ingo Weinhold
e6466c9a34 package extract: Delay setting node permissions
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.
2011-11-25 06:18:38 +01:00
Ingo Weinhold
f2db3c439d .OPD -> .PackageInfo conversion tool 2011-11-25 06:18:38 +01:00
Ingo Weinhold
4ebd3de828 Support package info [source] URL attributes 2011-11-25 06:18:37 +01:00
Ingo Weinhold
4b6a3a9c5f Change source URL package info attribute name
Use "-" instead of "_".
2011-11-25 06:18:36 +01:00
Ingo Weinhold
029f6d0d05 Simplify BPackageInfo::Parser::_Parse() further
* 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.
2011-11-25 06:18:36 +01:00