Commit Graph

6 Commits

Author SHA1 Message Date
Ingo Weinhold e527b79631 Switch package file accessor classes to use BPositionIO
* PackageFileHeap{Reader,Writer} as well as Package{Reader,Writer} and
  their implementation and super classes do now internally use a
  BPositionIO instead of a FD to access the package file. This provides
  more flexibility needed for features to come.
* BPackageReader has already grown a new Init() version with a
  BPositionIO* parameter.
2014-07-12 15:40:22 +02:00
Ingo Weinhold e85334022e Repository file format: group attributes of a package
* Introduce new package attribute B_HPKG_ATTRIBUTE_ID_PACKAGE (valid
  only in a repository file) to group the attributes belonging to a
  package.
* BRepositoryContentHandler:
  - No longer derive from BPackageContentHandler.
  - Add hooks HandlePackage() and HandlePackageDone() that bracket the
    attributes for a package. This is more explicit and robust than
    handlers having to guess when one package ended and the next began.
* BRepositoryCache: Make use of BPackageInfoContentHandler. No need to
  duplicate the code for reading a package info from package info
  attributes.
2013-07-04 19:20:14 +02:00
Ingo Weinhold 1f633814fa hpkg format: compress the whole heap
Instead of handling compression for individual file/attribute data we
do now compress the whole heap where they are stored. This
significantly improves compression ratios. We still divide the
uncompressed data into 64 KiB chunks and use a chunk offset array for
the compressed chunks to allow for quick random access without too much
overhead. The tradeoff is a limited possible compression ratio -- i.e.
we won't be as good as tar.gz (though surprisingly with my test
archives we did better than zip).

The other package file sections (package attributes and TOC) are no
longer compressed individually. Their uncompressed data are simply
pushed onto the heap where the usual compression strategy applies. To
simplify things the repository format has been changed in the same
manner although it doesn't otherwise use the heap, since it only stores
meta data.

Due to the data compression having been exposed in public and private
API, this change touches a lot of package kit using code, including
packagefs and the boot loader packagefs support. The latter two haven't
been tested yet. Moreover packagefs needs a new kind of cache so we
avoid re-reading the same heap chunk for two different data items it
contains.
2013-05-25 01:12:25 +02:00
Oliver Tappe 2b6e6760b6 * add listing of repository attributes to 'package_repo list'
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-15 12:48:02 +00:00
Oliver Tappe 34d56c1bf5 * implemented repository reader and fixed some bugs in writer that
have been exposed during testing of reader

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40494 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-14 20:25:10 +00:00
Oliver Tappe 33bc4425be Largish adjustments to PackagerReaderImpl and package attribute
handling:
* package attributes are now compatible with the low level attribute
  handling of other HPKG attributes (such that 'package dump' now shows 
  package attributes, too)
* dropped type names from hpkg format, the attributes were identified
  by IDs already and this simplifies the code considerably. Type names
  are now handled in BLowLevelPackageHandler only.
* instead of rolling their own mechanism, high-level package attributes 
  handling is now implemented via a corresonding set of 
  AttributeHandler-subclasses
* adjusted package writer to only write package attributes that are
  needed (empty ones are left out)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40466 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-12 19:21:37 +00:00