History log of /haiku/src/kits/package/hpkg/PackageWriterImpl.cpp
Revision Date Author Comments
# b08627f3 04-May-2018 Murai Takashi <tmurai01@gmail.com>

Fix catching polymorphic type by value

Replace catching polymorphic type std::bad_alloc 'by value'
with 'by reference'.
Pointed by gcc8


# e1e6c124 13-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter::Recompress(): Change param to BPositionIO*

Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.


# 44c47711 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add BPositionIO support


# 8f5130ed 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: Actually add support for B_HPKG_COMPRESSION_NONE

Until now we always declared in the HPKG header that the package file is
zlib compressed. For uncompressed files we would just store all
individual chunks uncompressed. Now we handle completely uncompressed
files slightly differently: We don't write the redundant chunk size
table anymore. The size savings are minor, but it makes the uncompressed
format read-streamable which may be handy.


# e527b796 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# cdfeba5a 08-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add Recompress()

Allows rewriting an existing package file with a different compression.


# 2fc2aebc 07-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Move _Finish() impl to match order in header


# 6a89a36a 24-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Move package kit Zlib* classes to support kit

Also move to B* namespace and no longer expose the zlib dependency in
the headers.


# 32832cbe 23-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove BPackageKit::BDataOutput

Use BDataIO instead.


# d2d1af83 18-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Revert "Move ZlibDecompressor to libshared"

This reverts commit 9af2105d36856be60528c361edf14a263f242338.

Conflicts:
src/kits/package/Jamfile


# 9af2105d 10-Feb-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

Move ZlibDecompressor to libshared

* This will be used to implement compressed http streams
* Remove the custom BDataOutput class, and use BDataIO instead, for
easier integration with existing code.


# fc198cc3 21-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriteImpl: Report error when failing to read .PackageInfo

Fixes #10228.


# 3f40dcb6 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_AttributeRemoved(): Update string cache

When removing a string attribute, decrement the referenced string's
usage count in the string cache. This fixes the potentially incorrect
usage counts in update mode. Not a serious problem, but it could lead
to only singly (or no longer) used strings to be written to the string
subsection instead of encoding them inline and thus to slightly greater
file sizes.


# c9ed1ea2 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Fix package file heap leak on update

_Init(): In update mode remove the package attributes section and the
TOC section from the package file's heap. We write the updated sections
in Finish(); previously the space for the old sections would be leaked.
This was also the reason why updating haiku_loader would result in a
non-bootable image.


# 86cdd3f8 27-Sep-2013 Axel Dörfler <axeld@pinc-software.de>

PackageWriterImpl: improve error output.


# 695a1b24 04-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

repository writer: fix use of incorrect header size

The header size of the package file header was used, which resulted in
broken repository files.


# 47039b85 21-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Package/repository file format: Add a minor version header field

* Add minor_version to hpkg_header and hpkg_repo_header and make
heap_compression uint16.
* If the minor version of a package/repository file is greater than the
current one unknown attributes are ignored without error. This allows
introducing new harmless attributes without making the resulting files
unreadable for older package kit versions.


# 46122852 21-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Add caching for the package file heap reader

* ReaderImplBase:
- Add virtual CreateCachedHeapReader() which can create a cached
reader based on the given heap reader.
- Rename HeapReader() to RawHeapReader() and add HeapReader() for the
cached heap reader.
- Add DetachHeapReader() to allow a clients to remove the heap
reader(s) after deleting the ReaderImplBase object.
* packagefs:
- Add CachedDataReader class, which wraps a given
BAbstractBufferedDataReader and provides caching for it using a
VMCache. The implementation is based on the IOCache implementation.
- Use CachedDataReader to wrap the heap reader. For file data that
means they are cached twice -- in the heap reader cache and in the
file cache -- but due to the heap reader using a VMCache as well,
the pages will be recycled automatically anyway. For attribute data
the cache should be very helpful, since they weren't cached at all
before.


# d59e0feb 20-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package: Suppress version mismatch errors where V1 is supported

* Add flags parameter to Init() of BPackageReader and friends.
* Introduce flag B_HPKG_READER_DONT_PRINT_VERSION_MISMATCH_MESSAGE and
don't print a version mismatch error when given.
* package extract/list: Use the new flag.


# 172f25fd 18-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Fix reading the package-info in update mode


# 796343ed 18-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Allow specifying the compression level for package creation

* Introduce BPackageWriterParameters which comprises all parameters
for package creation, currently flags and compression level. Such an
object can be passed to BPackageWriter::Init() and is passed on to
PackageWriterImpl and WriterImplBase.
* PackageFileHeapWriter: Add compressionLevel property and pass the
value on to ZlibCompressor.
* package add/create: Add options -0 ... -9 to specify the compression
level to be used.


# 1f633814 17-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 21ee6d5c 14-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Some comment updates


# 0ee16518 14-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Rename BBlockBufferCache and friends to *Pool*

Also move BBlockBufferPoolNoLock into BHPKG namespace with the other
classes. Not sure why it wasn't there before.


# 2c32402d 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: internalize BPackageDataReader

It is no longer public (or even private) API. BPackageDataReaderFactory
returns a BAbstractBufferedDataReader instead. The advantage is that
the latter doesn't have hpkg format specific dependencies.


# 171fd58c 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: some fixes for multi-version support

* Use enums/constants/functions instead of preprocessor macros.
* Missing include in PackageInfoAttributeValue.h.
* PackageReaderImpl::Init(): Check version before header size and
return B_MISMATCHED_VALUES instead of B_BAD_DATA, if the version
doesn't match. This allows callers to determine the condition and
try a reader for a different version. A more flexible interface for
that case would be nice, but since we want to support the old package
version only temporarily, the current solution should be good enough.


# 0e35d5d2 12-Dec-2011 John Scipione <jscipione@gmail.com>

Change instances of wether in comments to whether. No functional change intended.


# f96d3856 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed left-over code


# 9968845d 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use BStringList in package kit

Replace all instances of BObjectList<BString> by BStringList.


# 6ae0ecd4 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a package info "install-path" attribute

The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.


# 7efa133c 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add SetCheckLicenses()

The default is still "true", but now it is possible to disable the
license check.


# e7c648e0 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 420a5c3e 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove copy'n'paste left-over


# 4d639659 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix "package add" heap compacting

PackageWriterImpl::_CompactHeap(): Incorrectly used fHeapEnd instead of
the heap size. So the last copied chunk was too large.


# f4417e14 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_MoveHeapChunk(): better output


# 8ffba2a6 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Write uncompressed package file TOC, if necessary


# 00bc8e9c 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# de9e64b2 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 443be501 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use fHeapOffset instead of sizeof(hpkg_header)


# e6ebdaaf 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move RegisterPackageInfo() to Finish()


# b6d9fe9a 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_AddEntry(): Improve output

Print the relative path instead of only the leaf name.


# 8524dd36 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

SubPathAdder: Check for overflows, omit initial /


# 37880dd0 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove debug output


# 0f9a98a4 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 85e13d1e 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove the build platform work-arounds


# 7ea4dbce 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Hard code "Public Domain" as acceptable license


# caa4217e 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Build platform symlink issues

On a non-Haiku build platform map openat(), fstat(), and
FileDescriptorCloser to _kern_open(), _kern_read_stat(), and
BuildFileDescriptorCloser respectively, so symlinks can be opened and
stat()ed.


# 7162cff6 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

<build>package: attribute iteration, license dir

PackageWriterImpl:
* Iterate through attributes using fs_read_attr_dir() instead of
readdir(). Makes it work correctly on the build platform.
* On the build platform look up the system licenses in their source
directory rather than based on find_directory().


# d62ec0bd 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed host build issues/warnings


# f195cdc8 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed left-over code


# 2021c984 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use BStringList in package kit

Replace all instances of BObjectList<BString> by BStringList.


# f19957b8 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a package info "install-path" attribute

The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.


# d7227dfa 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add SetCheckLicenses()

The default is still "true", but now it is possible to disable the
license check.


# 718fba99 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 3095cb1b 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove copy'n'paste left-over


# f79277d0 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix "package add" heap compacting

PackageWriterImpl::_CompactHeap(): Incorrectly used fHeapEnd instead of
the heap size. So the last copied chunk was too large.


# cc3f28c0 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_MoveHeapChunk(): better output


# 6f785748 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Write uncompressed package file TOC, if necessary


# 327b38d6 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 7b6bcdb1 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 04258e47 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use fHeapOffset instead of sizeof(hpkg_header)


# abbeb15a 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move RegisterPackageInfo() to Finish()


# ffa2b210 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_AddEntry(): Improve output

Print the relative path instead of only the leaf name.


# 82af91fb 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

SubPathAdder: Check for overflows, omit initial /


# 285f4a32 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove debug output


# 4512e8d5 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# bd530a08 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove the build platform work-arounds


# d00bcc16 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Hard code "Public Domain" as acceptable license


# 93211f33 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Build platform symlink issues

On a non-Haiku build platform map openat(), fstat(), and
FileDescriptorCloser to _kern_open(), _kern_read_stat(), and
BuildFileDescriptorCloser respectively, so symlinks can be opened and
stat()ed.


# e272fb5d 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

<build>package: attribute iteration, license dir

PackageWriterImpl:
* Iterate through attributes using fs_read_attr_dir() instead of
readdir(). Makes it work correctly on the build platform.
* On the build platform look up the system licenses in their source
directory rather than based on find_directory().


# 14c34be2 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed host build issues/warnings


# 33bc4425 12-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

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


# 91ebce66 10-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Some cleanup, no functional change
* typedef base classes as 'inherited' and use that instead of the
explicit base class name
* remove superfluous scopes in case blocks


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40420 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d77c6cd2 08-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implemented checking of licenses, such that it is no longer possible
to create a package that refers to a license that is not a system
license or contained in the package
* added package-info flags (currently only approve_license and
system_package)
* adjusted package-reader/writer and pkgman accordingly

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40393 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ee7d007 08-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup:
* PackageWriterImpl no longer accesses members of WriterImplBase
directly, but uses getters/setters instead
* package attribute registration has been moved from PackageWriterImpl
to WriterImplBase, as it will be used in the same manner by the
RepositoryWriter


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40388 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f2022173 07-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring step towards implementation of RepositoryWriter:
* pulled commonly useful parts out of PackageWriterImpl into
WriterImplBase
* moved CachedStringTable and related methods into a separate class,
StringCache, in order to support having more than one string cache
per package file
* made package attribute section use a string cache, too, as that's
going to be very useful for repositories
* instead of writing package attributes directly, we now collect
corresponding PackageAttributes and write those later
* adjusted package reader accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40376 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aaf05784 07-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* some rearrangements and renames with respect to public/private
types and defines of HPKG
* added header, magic and version for haiku repository format

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40370 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fd9c0b33 04-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* added support for compressing the package attributes section to
PackageWriterImpl
* added my own copyright

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40358 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6f0278cd 04-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Implemented reading of package info attributes from hpkg file
* added kernel-compatible datatypes for reading package info attribute
values (PackageInfoAttributeValue.h) - these will be used at a later
stage by the package-fs to transport those attributes to userland
when asked to do so (by ioctl)
* implemented parsing of package info attributes in PackageReaderImpl
* added support for compressed package attribute section to
PackageReaderImpl
* completed the writing of package info attributes in PackageWriterImpl
and fixed a couple of bugs exposed by parsing
* adjusted 'package list' to show the package info attributes as they
are found


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 68dc1eb6 01-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implemented writing of package attributes to hpkg file

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7fd711ef 31-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* refactored PackageWriter(Impl) to no longer print anything itself,
but publish that info through a BPackageWriterListener
* adjusted 'package create' to print a package summary by default and
more verbose info upon request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40332 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15a5c3f7 31-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* follow hint by Axel: drop FDCloser and use shared class
FileDescriptorCloser instead


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40330 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fb1c6ff 30-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

Refactored hpkg implementation to provide some separation between
public and private API (still far from ideal, but a start):
* moved several HPKG-classes into the public namespace BPackageKit::HPKG
* added fImpl-wrappers around PackageReader and PackageWriter to hide
most of the gory details
* adjusted 'package'-binary and packagefs accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40320 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e1e6c124809fae466b89b13ef1ecf87f8026d7fb 13-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter::Recompress(): Change param to BPositionIO*

Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.


# 44c4771163b9166dc042f69cb5373c9de9e37006 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add BPositionIO support


# 8f5130edfa454cc7ee21e4c3aef2a151f7c3c567 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: Actually add support for B_HPKG_COMPRESSION_NONE

Until now we always declared in the HPKG header that the package file is
zlib compressed. For uncompressed files we would just store all
individual chunks uncompressed. Now we handle completely uncompressed
files slightly differently: We don't write the redundant chunk size
table anymore. The size savings are minor, but it makes the uncompressed
format read-streamable which may be handy.


# e527b796319f21ca025f68e1964df140daa6de35 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# cdfeba5a1e49d0993e7ab6853c77392bbc10d3c4 08-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add Recompress()

Allows rewriting an existing package file with a different compression.


# 2fc2aebcba504f169142344ff04ae75fbb0e7ccb 07-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Move _Finish() impl to match order in header


# 6a89a36aa0ce6a53f9758ba767863ac6b4c6156c 24-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Move package kit Zlib* classes to support kit

Also move to B* namespace and no longer expose the zlib dependency in
the headers.


# 32832cbe47f991cc6d2b29824903181d8baaaa63 23-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove BPackageKit::BDataOutput

Use BDataIO instead.


# d2d1af830b3f144937ea5e4c3f0e5b74c4c3d737 18-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Revert "Move ZlibDecompressor to libshared"

This reverts commit 9af2105d36856be60528c361edf14a263f242338.

Conflicts:
src/kits/package/Jamfile


# 9af2105d36856be60528c361edf14a263f242338 10-Feb-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

Move ZlibDecompressor to libshared

* This will be used to implement compressed http streams
* Remove the custom BDataOutput class, and use BDataIO instead, for
easier integration with existing code.


# fc198cc3e49f7141d8217f09353d29d35856645b 21-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriteImpl: Report error when failing to read .PackageInfo

Fixes #10228.


# 3f40dcb6b457b3560ba6e5c190e52b18b5531bc2 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_AttributeRemoved(): Update string cache

When removing a string attribute, decrement the referenced string's
usage count in the string cache. This fixes the potentially incorrect
usage counts in update mode. Not a serious problem, but it could lead
to only singly (or no longer) used strings to be written to the string
subsection instead of encoding them inline and thus to slightly greater
file sizes.


# c9ed1ea292780eb14b2652974c2623cc7ed0574f 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Fix package file heap leak on update

_Init(): In update mode remove the package attributes section and the
TOC section from the package file's heap. We write the updated sections
in Finish(); previously the space for the old sections would be leaked.
This was also the reason why updating haiku_loader would result in a
non-bootable image.


# 86cdd3f81a805c95f70035eb0be28a46ac3745f5 27-Sep-2013 Axel Dörfler <axeld@pinc-software.de>

PackageWriterImpl: improve error output.


# 695a1b248a193f9a403d76d3b32666240ee76fcc 04-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

repository writer: fix use of incorrect header size

The header size of the package file header was used, which resulted in
broken repository files.


# 47039b852eeebb91396d19e0f9313cf23bf535ee 21-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Package/repository file format: Add a minor version header field

* Add minor_version to hpkg_header and hpkg_repo_header and make
heap_compression uint16.
* If the minor version of a package/repository file is greater than the
current one unknown attributes are ignored without error. This allows
introducing new harmless attributes without making the resulting files
unreadable for older package kit versions.


# 46122852f1dfbbf4bac6f5a634452ff90c5635ce 21-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Add caching for the package file heap reader

* ReaderImplBase:
- Add virtual CreateCachedHeapReader() which can create a cached
reader based on the given heap reader.
- Rename HeapReader() to RawHeapReader() and add HeapReader() for the
cached heap reader.
- Add DetachHeapReader() to allow a clients to remove the heap
reader(s) after deleting the ReaderImplBase object.
* packagefs:
- Add CachedDataReader class, which wraps a given
BAbstractBufferedDataReader and provides caching for it using a
VMCache. The implementation is based on the IOCache implementation.
- Use CachedDataReader to wrap the heap reader. For file data that
means they are cached twice -- in the heap reader cache and in the
file cache -- but due to the heap reader using a VMCache as well,
the pages will be recycled automatically anyway. For attribute data
the cache should be very helpful, since they weren't cached at all
before.


# d59e0feb59b92ca19ecda2935369fd0fcc5a4f56 20-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package: Suppress version mismatch errors where V1 is supported

* Add flags parameter to Init() of BPackageReader and friends.
* Introduce flag B_HPKG_READER_DONT_PRINT_VERSION_MISMATCH_MESSAGE and
don't print a version mismatch error when given.
* package extract/list: Use the new flag.


# 172f25fdda75f2ab92089511c89f0ee37483504e 18-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Fix reading the package-info in update mode


# 796343ed73b1707ed97e91e22b72b8ca81bcdbad 18-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Allow specifying the compression level for package creation

* Introduce BPackageWriterParameters which comprises all parameters
for package creation, currently flags and compression level. Such an
object can be passed to BPackageWriter::Init() and is passed on to
PackageWriterImpl and WriterImplBase.
* PackageFileHeapWriter: Add compressionLevel property and pass the
value on to ZlibCompressor.
* package add/create: Add options -0 ... -9 to specify the compression
level to be used.


# 1f633814fa347b0bd822f683af731615df600347 17-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 21ee6d5cdce51e891eebc0b28efe8aad631bfc1c 14-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Some comment updates


# 0ee1651856a4364bfa7ffd10f796baf35fb524d3 14-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Rename BBlockBufferCache and friends to *Pool*

Also move BBlockBufferPoolNoLock into BHPKG namespace with the other
classes. Not sure why it wasn't there before.


# 2c32402da583cbd0a091a08308237592679c05c4 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: internalize BPackageDataReader

It is no longer public (or even private) API. BPackageDataReaderFactory
returns a BAbstractBufferedDataReader instead. The advantage is that
the latter doesn't have hpkg format specific dependencies.


# 171fd58c4b47c2da9cf13b7e501d3661d4a98e42 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: some fixes for multi-version support

* Use enums/constants/functions instead of preprocessor macros.
* Missing include in PackageInfoAttributeValue.h.
* PackageReaderImpl::Init(): Check version before header size and
return B_MISMATCHED_VALUES instead of B_BAD_DATA, if the version
doesn't match. This allows callers to determine the condition and
try a reader for a different version. A more flexible interface for
that case would be nice, but since we want to support the old package
version only temporarily, the current solution should be good enough.


# 0e35d5d2e5ef3d288e056d60ef1b16dc399eaa0c 12-Dec-2011 John Scipione <jscipione@gmail.com>

Change instances of wether in comments to whether. No functional change intended.


# f96d3856e1609756c637c9dede668353c52bf76c 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed left-over code


# 9968845d6988000a9235d7eb09031e80d997f31d 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use BStringList in package kit

Replace all instances of BObjectList<BString> by BStringList.


# 6ae0ecd49a584abd81f3fa0fb0c0dd5b7a3ddb71 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a package info "install-path" attribute

The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.


# 7efa133cb45708be6f134f3dc60a0426beaeb440 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add SetCheckLicenses()

The default is still "true", but now it is possible to disable the
license check.


# e7c648e06dbbc79c296fe7c2918421c6081a1439 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 420a5c3e4231d05f9ad3b961764b5b05ba4f1ca9 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove copy'n'paste left-over


# 4d63965914e781125c29105ce20e9d89aa198d99 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix "package add" heap compacting

PackageWriterImpl::_CompactHeap(): Incorrectly used fHeapEnd instead of
the heap size. So the last copied chunk was too large.


# f4417e14faf2c846db9a78d0f10307e3d58a786f 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_MoveHeapChunk(): better output


# 8ffba2a6cbd6f0bafeb7380bec6a73ab55e97c78 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Write uncompressed package file TOC, if necessary


# 00bc8e9cbd92f6a812d75ad75ca91c34beb67e72 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# de9e64b235bffc7bc03fa006dca67f9df0178105 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 443be501c0c6da38a0efc1c803e8e53aa9cbdbfb 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use fHeapOffset instead of sizeof(hpkg_header)


# e6ebdaaf210e003557a5587a477582210933bf9f 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move RegisterPackageInfo() to Finish()


# b6d9fe9a6b7bdd9febc09fe9c5e8b43079530733 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_AddEntry(): Improve output

Print the relative path instead of only the leaf name.


# 8524dd366041c1838536000b5deeed22c5ebbff4 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

SubPathAdder: Check for overflows, omit initial /


# 37880dd0a78fe2263fd742f72a21c1d9fa53ac20 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove debug output


# 0f9a98a4194cd773a14affbf7aba5de5a2800b81 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 85e13d1ef8117de0fd425578ac135295401bb79b 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove the build platform work-arounds


# 7ea4dbcecf5458f07107dc4a8e5fac7f0d2c89e9 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Hard code "Public Domain" as acceptable license


# caa4217eb51697290a7248e028e7803c31cfc5c3 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Build platform symlink issues

On a non-Haiku build platform map openat(), fstat(), and
FileDescriptorCloser to _kern_open(), _kern_read_stat(), and
BuildFileDescriptorCloser respectively, so symlinks can be opened and
stat()ed.


# 7162cff6b0ace7dd53d95d732e17a9ae7ff5f2d2 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

<build>package: attribute iteration, license dir

PackageWriterImpl:
* Iterate through attributes using fs_read_attr_dir() instead of
readdir(). Makes it work correctly on the build platform.
* On the build platform look up the system licenses in their source
directory rather than based on find_directory().


# d62ec0bd759ccd6ba3c0efdfe7a9f61e954500da 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed host build issues/warnings


# f195cdc8c0274c685edc51cc0513d6066da49fd6 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed left-over code


# 2021c9842e1e61a3bf0f6550725ec3baf53d44b1 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use BStringList in package kit

Replace all instances of BObjectList<BString> by BStringList.


# f19957b8e5311ffc5b802032e4f24cdda81f9b50 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a package info "install-path" attribute

The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.


# d7227dfa9e644112f7019d94b4611da400c6c884 11-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageWriter: Add SetCheckLicenses()

The default is still "true", but now it is possible to disable the
license check.


# 718fba99c819b419a8eccff713a3ff71b44a2ecb 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 3095cb1bc9f5d9bafa4b5d2ead76449c99567c4a 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove copy'n'paste left-over


# f79277d0e707ed8ec4d2349108d17b99a2287488 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix "package add" heap compacting

PackageWriterImpl::_CompactHeap(): Incorrectly used fHeapEnd instead of
the heap size. So the last copied chunk was too large.


# cc3f28c0b5237b9afc9a26ebc90aed6e50c2dc32 03-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_MoveHeapChunk(): better output


# 6f785748aa1fef5bb193e17ff243794250004ac6 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Write uncompressed package file TOC, if necessary


# 327b38d69c8d9a128c64d0535f15b0274b51c51b 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 7b6bcdb146b8ac24ef3569fcb152627f724e156c 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# 04258e474118bc6d00e704d058723aec6fcf193f 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Use fHeapOffset instead of sizeof(hpkg_header)


# abbeb15ac4f2b6524852c09a35db7b3b90b0cd3c 02-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move RegisterPackageInfo() to Finish()


# ffa2b2104bfa68250f1308b0d8f74b9b5ee35d55 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl::_AddEntry(): Improve output

Print the relative path instead of only the leaf name.


# 82af91fb0ecc92d000d8be513d71353961bffd71 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

SubPathAdder: Check for overflows, omit initial /


# 285f4a321ab6fbfc7988f37ef3ef9b64f0aadbc4 01-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove debug output


# 4512e8d5669716c2d0e41f6f117cb86635482ebc 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


# bd530a0800c184d4fcc0091fa4c7949697e58b1d 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove the build platform work-arounds


# d00bcc16079d008ee89ee4644a009d53e3798a8d 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Hard code "Public Domain" as acceptable license


# 93211f331fa18d566cedcbf86ea6554af074ad96 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageWriterImpl: Build platform symlink issues

On a non-Haiku build platform map openat(), fstat(), and
FileDescriptorCloser to _kern_open(), _kern_read_stat(), and
BuildFileDescriptorCloser respectively, so symlinks can be opened and
stat()ed.


# e272fb5dec8ed35de0ad8303f675c4d9602777c8 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

<build>package: attribute iteration, license dir

PackageWriterImpl:
* Iterate through attributes using fs_read_attr_dir() instead of
readdir(). Makes it work correctly on the build platform.
* On the build platform look up the system licenses in their source
directory rather than based on find_directory().


# 14c34be2e11541af33f8a19f620c66a28810acef 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed host build issues/warnings


# 33bc4425be0b545ed3d0b7e7a9a873d31e5a0330 12-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

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


# 91ebce663d5f11e5763851ad131e55d4c020421b 10-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Some cleanup, no functional change
* typedef base classes as 'inherited' and use that instead of the
explicit base class name
* remove superfluous scopes in case blocks


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40420 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d77c6cd26a5cf3863ba4258a063d7d8645abf1e3 08-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implemented checking of licenses, such that it is no longer possible
to create a package that refers to a license that is not a system
license or contained in the package
* added package-info flags (currently only approve_license and
system_package)
* adjusted package-reader/writer and pkgman accordingly

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40393 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ee7d007d6aa14cd7d9286e52dbb57580fd8f8f7 08-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup:
* PackageWriterImpl no longer accesses members of WriterImplBase
directly, but uses getters/setters instead
* package attribute registration has been moved from PackageWriterImpl
to WriterImplBase, as it will be used in the same manner by the
RepositoryWriter


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40388 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f202217364f40d170b7bf07b60a75457b275b0c1 07-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring step towards implementation of RepositoryWriter:
* pulled commonly useful parts out of PackageWriterImpl into
WriterImplBase
* moved CachedStringTable and related methods into a separate class,
StringCache, in order to support having more than one string cache
per package file
* made package attribute section use a string cache, too, as that's
going to be very useful for repositories
* instead of writing package attributes directly, we now collect
corresponding PackageAttributes and write those later
* adjusted package reader accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40376 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aaf05784d48abf7b2a24609ea200b29bc144a752 07-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* some rearrangements and renames with respect to public/private
types and defines of HPKG
* added header, magic and version for haiku repository format

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40370 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fd9c0b33616cfc25e833baa6e4a51deeee366634 04-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* added support for compressing the package attributes section to
PackageWriterImpl
* added my own copyright

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40358 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6f0278cdc9a22a1e22c3ac3f480beffd6bb5fcff 04-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Implemented reading of package info attributes from hpkg file
* added kernel-compatible datatypes for reading package info attribute
values (PackageInfoAttributeValue.h) - these will be used at a later
stage by the package-fs to transport those attributes to userland
when asked to do so (by ioctl)
* implemented parsing of package info attributes in PackageReaderImpl
* added support for compressed package attribute section to
PackageReaderImpl
* completed the writing of package info attributes in PackageWriterImpl
and fixed a couple of bugs exposed by parsing
* adjusted 'package list' to show the package info attributes as they
are found


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 68dc1eb6adc2e36ec99677a03e20c42c5cc7c5f6 01-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implemented writing of package attributes to hpkg file

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7fd711ef9999af8ce8dc6c44509ee154230b8d90 31-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* refactored PackageWriter(Impl) to no longer print anything itself,
but publish that info through a BPackageWriterListener
* adjusted 'package create' to print a package summary by default and
more verbose info upon request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40332 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15a5c3f7d91ab7657dc13deee1a18ef9e9c14567 31-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* follow hint by Axel: drop FDCloser and use shared class
FileDescriptorCloser instead


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40330 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fb1c6ff1f55fe4094a761b653041b3a0b9abf1d 30-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

Refactored hpkg implementation to provide some separation between
public and private API (still far from ideal, but a start):
* moved several HPKG-classes into the public namespace BPackageKit::HPKG
* added fImpl-wrappers around PackageReader and PackageWriter to hide
most of the gory details
* adjusted 'package'-binary and packagefs accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40320 a95241bf-73f2-0310-859d-f6bbb57e9c96