History log of /haiku/src/bin/package/command_extract.cpp
Revision Date Author Comments
# 0c59a38e 26-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Drop debug leftover.


# e2732c07 25-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix 'package extract' with multiple explicit entries

* before adding a child to a parent entry, we need to check if the
parent already contains that child, as otherwise duplicate children
with identical names would be added, which in turn messes up the
handling of the entries that are to be extracted


# 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.


# 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.


# 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.


# 9172ffdb 13-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package list/extract: Add support for hpkg format V1


# 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.


# 0816749e 01-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package_repo: Removes dependency to package

* Move StandardErrorOutput to libpackage and into proper namespace to
avoid "package_repo" having to reuse the "package" source file.
* package_repo: Fix incorrect includes of "package.h".


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

Print relative paths in error messages


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

Support for extracting only specified entries


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

Add package extract -i option

Allows to specify an alternate location for the .PackageInfo.


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

Remove debug output


# e6466c9a 29-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


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

Nicer error output


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

Use fs_close_attr()/write_pos() instead of close()/pwrite().

This makes it easier to reuse the code on non-Haiku platforms.


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

Print relative paths in error messages


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

Support for extracting only specified entries


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

Add package extract -i option

Allows to specify an alternate location for the .PackageInfo.


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

Remove debug output


# 1ef35574 29-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


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

Nicer error output


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

Use fs_close_attr()/write_pos() instead of close()/pwrite().

This makes it easier to reuse the code on non-Haiku platforms.


# d662b834 14-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* moved BlockBufferCacheNoLock into package kit

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


# 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


# 0d68f6af 09-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Implemented repository writing:
* fleshed out RepositoryWriterImpl
* renamed BRepositoryHeader to BRepositoryInfo (in accordance with
BPackageInfo)
* adjusted BRepositoryInfo to be able to parse itself from a
driver_settings file
* added package_repo binary (only 'create' works as of yet)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40405 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


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

Fixed an oversight of yesterday's restructuring:
* FDCloser is private, so it should live in BPackageKit::BHPKG::BPrivate
* adjusted 'package' binary to no longer use FDCloser (trivial)
* minor cleanup in command_extract.cpp

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40329 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


# 0d6b3b20 27-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

More work on package kit:
* added class BPackageInfo, which contains packaging attributes of
a package (the values relevant for package management)
* implemented parser (mostly) for reading a BPackageInfo from a config
file (.PackageInfo) in order to pass them on to the PackageWriter
when creating a package
* pulled hpkg-related stuff from bin/package into the package kit
* adjusted packagefs-Volume to skip .PackageInfo files when populating
the mountpoint, as those files shouldn't appear as part of an
activated package


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


# 4e2cd771 18-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added new interface BufferCache -- basically a memory allocator with the
option to cache a freed buffer -- and implementations
BlockBufferCache{NoLock,Kernel}.
* ZlibPackageDataReader does now dynamically get its read and uncompress
buffers from a provided BufferCache when needed.
* Allocating the buffers once and keeping them over the whole life time was a
bit too memory heavy, since we create a reader for every file for which a
vnode is created. A FS module global factory provides a buffer cache.
* Added a mutex to PackageFile::DataAccessor which guards the access to the
data reader which isn't thread safe.


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


# 6dccfe13 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added interface ErrorOutput and implementation StandardErrorOutput and used
them in the PackageReader instead of fprintf().
* Got rid of unconditional printf().


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


# 03423585 15-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Incorrectly used errno instead of error.


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


# 050aa61b 13-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented a tool ("package") that implements creation and extraction of
packages of the newly invented Haiku Package format
(http://dev.haiku-os.org/wiki/PackageFormat). It basically works, but it's
still work in progress (e.g. compression is not implemented yet), as is the
format itself.


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


# 0c59a38ecd83b6775b950326054f3a091aebb612 26-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Drop debug leftover.


# e2732c07a833f2fd3bfe38a285202f4f0d501abd 25-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix 'package extract' with multiple explicit entries

* before adding a child to a parent entry, we need to check if the
parent already contains that child, as otherwise duplicate children
with identical names would be added, which in turn messes up the
handling of the entries that are to be extracted


# 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.


# 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.


# 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.


# 9172ffdb069412131d17ff731280f6f5802b52a0 13-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package list/extract: Add support for hpkg format V1


# 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.


# 0816749e41c0757e4e3269e18ffc333b64deb1c8 01-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package_repo: Removes dependency to package

* Move StandardErrorOutput to libpackage and into proper namespace to
avoid "package_repo" having to reuse the "package" source file.
* package_repo: Fix incorrect includes of "package.h".


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

Print relative paths in error messages


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

Support for extracting only specified entries


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

Add package extract -i option

Allows to specify an alternate location for the .PackageInfo.


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

Remove debug output


# e6466c9a347a96e75691e19e1373a5c9fc907e5f 29-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


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

Nicer error output


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

Use fs_close_attr()/write_pos() instead of close()/pwrite().

This makes it easier to reuse the code on non-Haiku platforms.


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

Print relative paths in error messages


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

Support for extracting only specified entries


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

Add package extract -i option

Allows to specify an alternate location for the .PackageInfo.


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

Remove debug output


# 1ef35574eb72074ae996c537d7ff26743c6844da 29-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

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.


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

Nicer error output


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

Use fs_close_attr()/write_pos() instead of close()/pwrite().

This makes it easier to reuse the code on non-Haiku platforms.


# d662b8345fd6dc21911a4abf97ae3c03b7debae5 14-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

* moved BlockBufferCacheNoLock into package kit

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


# 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


# 0d68f6afb34d8e01421123b216e34771d1c7fbfe 09-Feb-2011 Oliver Tappe <zooey@hirschkaefer.de>

Implemented repository writing:
* fleshed out RepositoryWriterImpl
* renamed BRepositoryHeader to BRepositoryInfo (in accordance with
BPackageInfo)
* adjusted BRepositoryInfo to be able to parse itself from a
driver_settings file
* added package_repo binary (only 'create' works as of yet)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40405 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


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

Fixed an oversight of yesterday's restructuring:
* FDCloser is private, so it should live in BPackageKit::BHPKG::BPrivate
* adjusted 'package' binary to no longer use FDCloser (trivial)
* minor cleanup in command_extract.cpp

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40329 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


# 0d6b3b20e15fe2cbeb5e81749f888c26ca289338 27-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

More work on package kit:
* added class BPackageInfo, which contains packaging attributes of
a package (the values relevant for package management)
* implemented parser (mostly) for reading a BPackageInfo from a config
file (.PackageInfo) in order to pass them on to the PackageWriter
when creating a package
* pulled hpkg-related stuff from bin/package into the package kit
* adjusted packagefs-Volume to skip .PackageInfo files when populating
the mountpoint, as those files shouldn't appear as part of an
activated package


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


# 4e2cd77109c257aa0be1e475ddcd379f9e9286df 18-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added new interface BufferCache -- basically a memory allocator with the
option to cache a freed buffer -- and implementations
BlockBufferCache{NoLock,Kernel}.
* ZlibPackageDataReader does now dynamically get its read and uncompress
buffers from a provided BufferCache when needed.
* Allocating the buffers once and keeping them over the whole life time was a
bit too memory heavy, since we create a reader for every file for which a
vnode is created. A FS module global factory provides a buffer cache.
* Added a mutex to PackageFile::DataAccessor which guards the access to the
data reader which isn't thread safe.


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


# 6dccfe13177dc5bd78931b94dab25425e625487d 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added interface ErrorOutput and implementation StandardErrorOutput and used
them in the PackageReader instead of fprintf().
* Got rid of unconditional printf().


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


# 03423585a40e6e23b8852055d71ca58172498855 15-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Incorrectly used errno instead of error.


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


# 050aa61bd63287302e92e90154489a6d353ca743 13-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented a tool ("package") that implements creation and extraction of
packages of the newly invented Haiku Package format
(http://dev.haiku-os.org/wiki/PackageFormat). It basically works, but it's
still work in progress (e.g. compression is not implemented yet), as is the
format itself.


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