History log of /haiku-fatelf/src/add-ons/kernel/file_systems/packagefs/Volume.cpp
Revision Date Author Comments
# b8ae1eb2 21-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume::_RemoveNodeAndVNode(): Squash TODO

Only get/remove/put the vnode when the node is actually known to the
VFS. This does not only save unnecessary work, it also solves a
(temporary) deadlock -- at least partially. If another thread caused a
call to our get_vnode() hook just before, it would block on the volume
lock we're holding when adding/removing packages. The vnode would be
marked busy until the other thread's request was fulfilled and our call
to get_vnode() would block until timing out. Now we're calling
get_vnode() only, if we already know that the VFS already has a valid
vnode.

There still remains a race condition. If the VFS discards the vnode
right before we call get_vnode(), we essentially have the same situation
as before (i.e. us calling get_vnode() although the vnode is no longer
known to the VFS) with the same potential problem. For a real solution
we need a get_vnode() variant which can be told not to block.


# 564f56b1 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix node handling on package addition/removal

* UnpackingLeafNode: Add a fFinalPackageNode attribute. It is set when
the node is about to be removed and will point to the node's previous
head package node and be used in its stead. From the perspective of
the FS hooks this leaves the node in an unchanged state.
* Unpacking[Leaf,Directory]Node:
- Add WillBeFirstPackageNode(), returning whether the given package
node would become the head package node when added.
- Add PrepareForRemoval() which removes all package nodes. In case of
UnpackingLeafNode it also sets fFinalPackageNode.
- Add CloneTransferPackageNodes(). It is only implemented for
UnpackingLeafNode. It clones the node, transfers all package nodes
to the clone and sets fFinalPackageNode on this node.
* Volume::_{Add,Remove}PackageNode(): Solved the following TODO: When a
package is added or removed and a file present in both the
added/removed package and another package with the version in the
former having precedence, we have to remove the node (leaving it
unchanged) and replace it by a new node. This prevents clients having
the node opened or mapped from suddenly seeing different data. It also
fixes unbalanced calls to PackageNode::VFSInit()/VFSUninit() which
would result in file descriptors to package files being leaked.


# 4ba3c257 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix package removal with skipped directories

Volume::_RemovePackageContentRootNode(): Check whether a directory
corresponding to the package directory does actually exist. This might
not be the case when the package directory has been skipped due to
clashing with a shine-through directory. Would crash in this case.


# 863eb983 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix typo


# 4caf2827 15-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix handling of shine-through directories

* Add a new class ShineThroughDirectory for shine-through directories
instead of using UnpackingDirectory.
* Split up setting up the shine-through directories in two steps. First
the directories are only created. That happens before adding the
initial package domains. After publishing the root node we bind the
shine-through directories to the underlying directories.
* This makes adding a package directory with the same name as a
shine-through directory fail in _AddPackageNode() as originally
intended. Since we no longer want it to fail -- the package daemon
will copy the files in the respective directories as part of the
activation process -- we simply skip the directory now. Adjust
_AddPackageNode() and _AddPackageContentRootNode() accordingly.


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

Notify earlier when removing a package node

Volume::_RemovePackageNode(): Notify listeners before removing the last
package node from the node, . This prevents the size/last modified
indices from not finding the node anymore, since the node would return
a default value instead of the value it was added to the index with.


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

Add install path support to packagefs


# 8db89f63 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Create a "BEOS:APP_SIG" index by default


# 28269859 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove unused PackageNodeAttribute::fParent


# ed81de86 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add last modified index support

* Add class LastModifiedIndex.
* Create and add an instance of it in Volume::Mount().


# 3793289c 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add size index support

* Add class SizeIndex.
* Create and add an instance of it in Volume mount.


# 182e58f7 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

NodeListener::NodeChanged(): Provide old value

* Add interface OldNodeAttributes an instance of which is passed to
NodeListener::NodeChanged() to provide the old attribute values
(currently only modification time and file size).
* Also extend PackageLinksListener::PackageLinkNodeChanged() with a
OldNodeAttributes parameter.
* Add OldNodeAttributes implementations for PackageLinkSymlink (inner
class OldAttributes) and UnpackingNode (OldUnpackageNodeAttributes).


# 617ac41c 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Query class and query management in Volume


# 331b89b3 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add NameIndex class and create instance in Volume


# 4791f5eb 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Index base class and index table in Volume


# ec59ac75 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a global node listener mechanism


# 239ce182 04-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix loading the resolvable compatible version


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

Add missing "cache" shine-through directory


# baa3cc3c 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Extract architecture from package file


# bc7e1813 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Small cleanup


# c5909fb0 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add compatible version support to packagefs


# 8f314372 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Introduce a pre-release version component

* The version string pattern is now:
<major>[.<minor>[.<micro>]][-<pre>][-<release>]
* Introduce B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_PRE_RELEASE package
attribute.
* Add "preRelease" field to BPackageVersionData.
* Add "preRelease" property to BPackageVersion and packagefs's Version.
* Adjust package reader and writer code accordingly.


# 9d918f95 25-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Paranoia: Handle unknown mount type


# 7403a215 25-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume:Mount(): Better failure output

Also use the FATAL() instead of the ERROR() macro, so something is
printed also with debugging disabled.


# 5e6d2a99 25-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Allow symlinks in the packages directory


# 3068366e 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add TODOs regarding broken add/remove behavior


# d8ea0a8a 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix package link updates/node monitoring

* PackageLinksListener: Rename methods from *Directory*() to *Node*()
and change parameter to Node*. Also add a *Changed() method.
* PackageLinkDirectory: Update only when necessary and what is necessary
(currently only the self link).


# 265b7e0d 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing locking when adding/removing package nodes


# 214d8aec 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add node monitoring for package link directories


# 452b059b 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Reordered methods to match declaration order


# be157836 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume: Remove all package contents on destruction


# f985352e 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix Volume::_RemovePackageLinksNode()

Don't use _RemoveNode() as it also removes the node from its parent.


# f9d2e7b3 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

If none is given pick volume name by mount type


# fcdac386 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Node::Init() flags parameter

* Add Node::Init() flags:
- NODE_FLAG_KEEP_NAME: Take over ownership of the name.
- NODE_FLAG_CONST_NAME: Don't copy the name -- it's a constant that
lives at least as long as the object.
* Remove Init() implementations in derived classes that just call the
base class version.


# fe49869e 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add package link directories to system volume

* Add PackageLinksListener interface. It is used by
PackageLink[s]Directory to notify a listener about changes.
* Volume does now implement PackageLinksListener and recursively adds/
removes package link directories.

This makes the package link directories appear at least. They are still
empty.


# 63875d17 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add yet empty package-links directory

* Add PackageLinksDirectory Directory subclass. Currently not doing
anything.
* PackageFSRoot: Create a PackageLinksDirectory.
* Volume: Add/remove the package links directory for the system volume.


# e16ce53b 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Pull derived UnpackingDirectory out of Directory

Move all package specifics from now abstract Directory to new derived
class UnpackingDirectory and adjust the Volume implementation
accordingly. This concludes the Node/Directory refactoring. Neither
class is aware of packages anymore.


# 097e795f 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Rename LeafNode to UnpackingLeafNode


# 20142717 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove package related dependencies from Node

* Move package related methods from Node to new interface UnpackingNode.
* LeafNode and Directory derive from UnpackingNode now.
* Adjust Volume implementation accordingly.


# 991ba9fd 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

WIP towards packagefs package links support

* Introduce Version class representing a version.
* Introduce Dependency and Resolvable class and add lists of either to
Package.
* Parse package attributes and add dependencies and resolvables to
Package.
* Add a mount type to Volume and add a respective mount parameter
"mount-type" (values "system", "common", "home", "custom"). Also
implies the shine-through type, if that's not given.
* Introduce class PackageFamily which groups equally named and versioned
packages.
* Add class PackageFSRoot. Each instance represents a possible file
system root (separate roots for different chroot environments). Tracks
Volumes belonging to the same root and their packages.


# cc1dc4db 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Rename Package "name" property to "fileName"


# 7ed608c6 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove debug output


# 6e2af637 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add support for shine-through directories

* packagefs_mount(): Initialize the fs_volume earlier, so it is more
usuable in Volume::Mount().
* The new mount parameter "shine-through" can be used to specify which
shine-through mode shall be used. Can be "system", "common", "home",
and "none". Depending on the setting it is decided which directories
of the underlying file system are bind-mounted on top of ours.
* Fix infinite loop in Volume::_RemovePackageContent().
* Use the RETURN_ERROR() macro in more places to help with debugging.


# 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


# 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


# 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


# 1f70af09 13-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* round up the value put into st_blocks
* inject modification time of package folder into root folder of
package-fs


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


# 80ddd8da 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* Volume::Mount(): fix KDL in case the volume-name was missing from
the mount parameters
* packagefs_read_stat(): put some sane value into st_blocks

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


# 4ca2f690 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* added support to packagefs for picking up its volume name from the
mount parameters - there doesn't seem to be a way for a filesystem
to access the path to which it was mounted, is there?


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


# 5cf8a6ab 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* rename 'domain'-parameter to 'packages', as that's less generic

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


# 6f8d1ab0 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implement fetching of initial domain from the mount parameters in
order to be able to mount packages from somewhere else than
'/boot/common/packages' (squashes a TODO)
* squashed another TODO about needing to remove nodes of already
installed packages if anything goes wrong during the activation
of a package domain
* fix what to me looks like a bug in Volume::AddPackageDomainJob::Do(),
fDomain is accessed unconditionally in the destructor, so NULLing
it here is bad (it doesn't make sense from a reference-passing POV
either). The problem never showed as this code is never being executed
currently (no way to add additional package domains as of yet)


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


# 45bd7bb3 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


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


# 2f59a69a 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed gcc2 build and warnings.


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


# d73033ce 21-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made PackageDomain BReferenceable.
* LeafNode/Directory: We make sure that the added PackageNode with the newest
modified time is always at the head of the list. This is the package node
whose stat, attribute data and, in case of non-directory nodes, also content
data will be returned. This results in a well-defined algorithm what happens
when multiple directories contain the same file -- the newest file wins.
* Resolved most TODOs regarding error handling when adding a package domain,
package, or package node.
* Volume::_AddPackageContentRootNode(): Fixed the back tracking loop. It would
just continue with siblings of the given root node, causing them to be added
more than once, leading to data structure corruption.
* We now listen to the packages directory. When packages are added or removed
their contents is automatically added/removed to the file system. We don't
listen to the package files themselves yet. I.e. modifying an "installed"
package in place respectively copying/downloading it there will probably not
work correctly.
Due to a limitation in the userlandfs the mechanism works correctly only when
using the kernel module. When running the userland version, one better leaves
the packages directory alone while packagefs is mounted.


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


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

* Extract the attributes from the package files and attach them as
PackageNodeAttribute to the PackageNodes.
* Implemented the attribute FS interface hooks.
* Made Package and PackageNode BReferenceable.
* Fixed the reference management for Node.


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


# 744a460c 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Package: Added Open() (and matching Close()) method, which opens the package
file once, tracking an open count.
* Added VFSInit()/VFSUninit() methods to the Node and PackageNode class
hierarchies, called by the {get,put}_vnode() PackageFile implements them to
set up/tear down access to the file data. Also added a Read() reading the
data.
* Implemented the open(), free_cookie(), and read() FS hooks for real. Reading
files works now. Executing doesn't yet -- it requires working with
IORequests in a way not supported by the userlandfs.


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


# 9ccaaa96 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Filter out write permissions.
* We now report more correct stat data. The information are retrieved from the
Package* objects.


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


# 694cb0b2 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented intermediate base class PackageLeafNode for PackageFile and
PackageSymlink with a "fat" interface.
* Replaced File and Symlink by fat class LeafNode.
* Added Package* object management to Directory and LeafNode.
* Implemented packagefs_read_symlink(), so symlinks work now.
* Added some missing locking the kernel interface.


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


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

Work in progress:
* The FS parses package files from "/boot/common/packages" and builds an
node tree representation of the contained entries. Merging directories should
work. Lots of other stuff is missing yet, though.
* Implemented the hooks for directory entry lookup and iteration. So it's
possible to see the contents of the FS at least.


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


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

Implemented the most basic functionality required to cleanly mount and unmount
(at least in userlandfs).


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


# b8ae1eb25dbc475d03214b118ad5dd3ddd0c3f05 21-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume::_RemoveNodeAndVNode(): Squash TODO

Only get/remove/put the vnode when the node is actually known to the
VFS. This does not only save unnecessary work, it also solves a
(temporary) deadlock -- at least partially. If another thread caused a
call to our get_vnode() hook just before, it would block on the volume
lock we're holding when adding/removing packages. The vnode would be
marked busy until the other thread's request was fulfilled and our call
to get_vnode() would block until timing out. Now we're calling
get_vnode() only, if we already know that the VFS already has a valid
vnode.

There still remains a race condition. If the VFS discards the vnode
right before we call get_vnode(), we essentially have the same situation
as before (i.e. us calling get_vnode() although the vnode is no longer
known to the VFS) with the same potential problem. For a real solution
we need a get_vnode() variant which can be told not to block.


# 564f56b15075b0d15349ebfcc24f07b33ce109a0 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix node handling on package addition/removal

* UnpackingLeafNode: Add a fFinalPackageNode attribute. It is set when
the node is about to be removed and will point to the node's previous
head package node and be used in its stead. From the perspective of
the FS hooks this leaves the node in an unchanged state.
* Unpacking[Leaf,Directory]Node:
- Add WillBeFirstPackageNode(), returning whether the given package
node would become the head package node when added.
- Add PrepareForRemoval() which removes all package nodes. In case of
UnpackingLeafNode it also sets fFinalPackageNode.
- Add CloneTransferPackageNodes(). It is only implemented for
UnpackingLeafNode. It clones the node, transfers all package nodes
to the clone and sets fFinalPackageNode on this node.
* Volume::_{Add,Remove}PackageNode(): Solved the following TODO: When a
package is added or removed and a file present in both the
added/removed package and another package with the version in the
former having precedence, we have to remove the node (leaving it
unchanged) and replace it by a new node. This prevents clients having
the node opened or mapped from suddenly seeing different data. It also
fixes unbalanced calls to PackageNode::VFSInit()/VFSUninit() which
would result in file descriptors to package files being leaked.


# 4ba3c257e483f645e08da8101a944a141bc01dde 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix package removal with skipped directories

Volume::_RemovePackageContentRootNode(): Check whether a directory
corresponding to the package directory does actually exist. This might
not be the case when the package directory has been skipped due to
clashing with a shine-through directory. Would crash in this case.


# 863eb983f855da9a7890b6a97c39db8e2759c785 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix typo


# 4caf282707b832ce5a9f86bce398ce466066f9f3 15-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix handling of shine-through directories

* Add a new class ShineThroughDirectory for shine-through directories
instead of using UnpackingDirectory.
* Split up setting up the shine-through directories in two steps. First
the directories are only created. That happens before adding the
initial package domains. After publishing the root node we bind the
shine-through directories to the underlying directories.
* This makes adding a package directory with the same name as a
shine-through directory fail in _AddPackageNode() as originally
intended. Since we no longer want it to fail -- the package daemon
will copy the files in the respective directories as part of the
activation process -- we simply skip the directory now. Adjust
_AddPackageNode() and _AddPackageContentRootNode() accordingly.


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

Notify earlier when removing a package node

Volume::_RemovePackageNode(): Notify listeners before removing the last
package node from the node, . This prevents the size/last modified
indices from not finding the node anymore, since the node would return
a default value instead of the value it was added to the index with.


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

Add install path support to packagefs


# 8db89f63362c7390aa0aeaf02198fc23250fdaaa 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Create a "BEOS:APP_SIG" index by default


# 28269859c84ca8d17a47ea55b8d264a44cd44c05 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove unused PackageNodeAttribute::fParent


# ed81de869e47eff53197b2a81a739a6da6e4b64c 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add last modified index support

* Add class LastModifiedIndex.
* Create and add an instance of it in Volume::Mount().


# 3793289c21d17d6e8f22c149879d4201871a4880 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add size index support

* Add class SizeIndex.
* Create and add an instance of it in Volume mount.


# 182e58f709cc0d9e0ae0f905874c13dfe38ce516 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

NodeListener::NodeChanged(): Provide old value

* Add interface OldNodeAttributes an instance of which is passed to
NodeListener::NodeChanged() to provide the old attribute values
(currently only modification time and file size).
* Also extend PackageLinksListener::PackageLinkNodeChanged() with a
OldNodeAttributes parameter.
* Add OldNodeAttributes implementations for PackageLinkSymlink (inner
class OldAttributes) and UnpackingNode (OldUnpackageNodeAttributes).


# 617ac41c601a395ce3065e44cc8355d792c33765 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Query class and query management in Volume


# 331b89b3a5568ad9efcd8a10aa587366753bc6a4 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add NameIndex class and create instance in Volume


# 4791f5ebb3bec07d9592b2bc5b461e269880ed3b 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Index base class and index table in Volume


# ec59ac751529851c81e8c3db96e06ba1b790dcbd 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a global node listener mechanism


# 239ce182abfc765a8efd1f4fc0efb62c36f7e7da 04-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix loading the resolvable compatible version


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

Add missing "cache" shine-through directory


# baa3cc3ca36ca821ccb6d7968fa115c89df68b60 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Extract architecture from package file


# bc7e1813740b0a8e681fa591b85f58607b224595 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Small cleanup


# c5909fb0d276c9226dadcdeb8b6c9596a0e25e52 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add compatible version support to packagefs


# 8f314372a8b317a4d9e2ebeccc0d5bf6e237fec7 26-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Introduce a pre-release version component

* The version string pattern is now:
<major>[.<minor>[.<micro>]][-<pre>][-<release>]
* Introduce B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_PRE_RELEASE package
attribute.
* Add "preRelease" field to BPackageVersionData.
* Add "preRelease" property to BPackageVersion and packagefs's Version.
* Adjust package reader and writer code accordingly.


# 9d918f950d253f8d45bb89dd07d3600f37bb3e0c 25-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Paranoia: Handle unknown mount type


# 7403a215d4180f0cea5f82c49e04231109e73a97 25-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume:Mount(): Better failure output

Also use the FATAL() instead of the ERROR() macro, so something is
printed also with debugging disabled.


# 5e6d2a99902a30047e3f2fa22145d54d9f41d58a 25-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Allow symlinks in the packages directory


# 3068366ed1209abf06593ad634bd36f4e970a67c 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add TODOs regarding broken add/remove behavior


# d8ea0a8a31ee4d741497bb8b2b08bd52577b06db 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix package link updates/node monitoring

* PackageLinksListener: Rename methods from *Directory*() to *Node*()
and change parameter to Node*. Also add a *Changed() method.
* PackageLinkDirectory: Update only when necessary and what is necessary
(currently only the self link).


# 265b7e0dfcd6431535562f6dc90ba92aeded88fd 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing locking when adding/removing package nodes


# 214d8aec133f597861cf3b460a645639b0f165ce 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add node monitoring for package link directories


# 452b059b3d6d5d385e5c5b620e87edb61144ccd1 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Reordered methods to match declaration order


# be1578363cbe7bfd8fe89d2af18344c1ad25920a 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume: Remove all package contents on destruction


# f985352ef10d79c5d923026ed27bf21073582d16 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix Volume::_RemovePackageLinksNode()

Don't use _RemoveNode() as it also removes the node from its parent.


# f9d2e7b39be0f729e6e87636017de02548d26c2d 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

If none is given pick volume name by mount type


# fcdac38641324da5f35f398d345c33c3fa12d920 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Node::Init() flags parameter

* Add Node::Init() flags:
- NODE_FLAG_KEEP_NAME: Take over ownership of the name.
- NODE_FLAG_CONST_NAME: Don't copy the name -- it's a constant that
lives at least as long as the object.
* Remove Init() implementations in derived classes that just call the
base class version.


# fe49869e03e724de875ad54c91f9f66275cfcf32 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add package link directories to system volume

* Add PackageLinksListener interface. It is used by
PackageLink[s]Directory to notify a listener about changes.
* Volume does now implement PackageLinksListener and recursively adds/
removes package link directories.

This makes the package link directories appear at least. They are still
empty.


# 63875d1702406f1bdc0e0f7adaa3492dd9fa3bdd 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add yet empty package-links directory

* Add PackageLinksDirectory Directory subclass. Currently not doing
anything.
* PackageFSRoot: Create a PackageLinksDirectory.
* Volume: Add/remove the package links directory for the system volume.


# e16ce53bccea3c101dadc1c4f4cfb73913aacd39 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Pull derived UnpackingDirectory out of Directory

Move all package specifics from now abstract Directory to new derived
class UnpackingDirectory and adjust the Volume implementation
accordingly. This concludes the Node/Directory refactoring. Neither
class is aware of packages anymore.


# 097e795f8e34d908418b06ae63d81d2f7916eb54 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Rename LeafNode to UnpackingLeafNode


# 20142717e78e3d349d0da642a8a5ae66a6d0a415 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove package related dependencies from Node

* Move package related methods from Node to new interface UnpackingNode.
* LeafNode and Directory derive from UnpackingNode now.
* Adjust Volume implementation accordingly.


# 991ba9fddf31971e08b038b0f84ff165c8cb94b7 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

WIP towards packagefs package links support

* Introduce Version class representing a version.
* Introduce Dependency and Resolvable class and add lists of either to
Package.
* Parse package attributes and add dependencies and resolvables to
Package.
* Add a mount type to Volume and add a respective mount parameter
"mount-type" (values "system", "common", "home", "custom"). Also
implies the shine-through type, if that's not given.
* Introduce class PackageFamily which groups equally named and versioned
packages.
* Add class PackageFSRoot. Each instance represents a possible file
system root (separate roots for different chroot environments). Tracks
Volumes belonging to the same root and their packages.


# cc1dc4db4c4b93636dce067ea0f1485e3f15de83 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Rename Package "name" property to "fileName"


# 7ed608c6155a6cdb32304b64e66c1b3c01c66f54 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove debug output


# 6e2af637b947771aa355359a615e6c889a783c6f 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add support for shine-through directories

* packagefs_mount(): Initialize the fs_volume earlier, so it is more
usuable in Volume::Mount().
* The new mount parameter "shine-through" can be used to specify which
shine-through mode shall be used. Can be "system", "common", "home",
and "none". Depending on the setting it is decided which directories
of the underlying file system are bind-mounted on top of ours.
* Fix infinite loop in Volume::_RemovePackageContent().
* Use the RETURN_ERROR() macro in more places to help with debugging.


# 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


# 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


# 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


# 1f70af09577410031686adc7c50321ef72f72195 13-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* round up the value put into st_blocks
* inject modification time of package folder into root folder of
package-fs


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


# 80ddd8dafcf2cde74a15bab4e6cf90a8708146f3 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* Volume::Mount(): fix KDL in case the volume-name was missing from
the mount parameters
* packagefs_read_stat(): put some sane value into st_blocks

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


# 4ca2f6909f31e3a740e29e41a79d045723124909 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* added support to packagefs for picking up its volume name from the
mount parameters - there doesn't seem to be a way for a filesystem
to access the path to which it was mounted, is there?


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


# 5cf8a6abc4c967e16ac03330d37eb21845c580e6 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* rename 'domain'-parameter to 'packages', as that's less generic

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


# 6f8d1ab0891a6914b775269ded62006bed03c8e1 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implement fetching of initial domain from the mount parameters in
order to be able to mount packages from somewhere else than
'/boot/common/packages' (squashes a TODO)
* squashed another TODO about needing to remove nodes of already
installed packages if anything goes wrong during the activation
of a package domain
* fix what to me looks like a bug in Volume::AddPackageDomainJob::Do(),
fDomain is accessed unconditionally in the destructor, so NULLing
it here is bad (it doesn't make sense from a reference-passing POV
either). The problem never showed as this code is never being executed
currently (no way to add additional package domains as of yet)


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


# 45bd7bb3db9d9e4dcb02b89a3e7c2bf382c0a88c 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


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


# 2f59a69a9a84f78d4757367c2084b2015e694d36 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed gcc2 build and warnings.


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


# d73033ce64d4d9b5c6e9831951fecc2398a95ca2 21-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made PackageDomain BReferenceable.
* LeafNode/Directory: We make sure that the added PackageNode with the newest
modified time is always at the head of the list. This is the package node
whose stat, attribute data and, in case of non-directory nodes, also content
data will be returned. This results in a well-defined algorithm what happens
when multiple directories contain the same file -- the newest file wins.
* Resolved most TODOs regarding error handling when adding a package domain,
package, or package node.
* Volume::_AddPackageContentRootNode(): Fixed the back tracking loop. It would
just continue with siblings of the given root node, causing them to be added
more than once, leading to data structure corruption.
* We now listen to the packages directory. When packages are added or removed
their contents is automatically added/removed to the file system. We don't
listen to the package files themselves yet. I.e. modifying an "installed"
package in place respectively copying/downloading it there will probably not
work correctly.
Due to a limitation in the userlandfs the mechanism works correctly only when
using the kernel module. When running the userland version, one better leaves
the packages directory alone while packagefs is mounted.


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


# 46776004f7f9bdf5af8c91372f050ee9f4e64076 18-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Extract the attributes from the package files and attach them as
PackageNodeAttribute to the PackageNodes.
* Implemented the attribute FS interface hooks.
* Made Package and PackageNode BReferenceable.
* Fixed the reference management for Node.


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


# 744a460c12f6471054cbb2e8472ea64d02e7b43e 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Package: Added Open() (and matching Close()) method, which opens the package
file once, tracking an open count.
* Added VFSInit()/VFSUninit() methods to the Node and PackageNode class
hierarchies, called by the {get,put}_vnode() PackageFile implements them to
set up/tear down access to the file data. Also added a Read() reading the
data.
* Implemented the open(), free_cookie(), and read() FS hooks for real. Reading
files works now. Executing doesn't yet -- it requires working with
IORequests in a way not supported by the userlandfs.


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


# 9ccaaa9642a7697d46bf6a8198e094b82982ab58 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Filter out write permissions.
* We now report more correct stat data. The information are retrieved from the
Package* objects.


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


# 694cb0b270e4acba08d83b0a520217081011ba28 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented intermediate base class PackageLeafNode for PackageFile and
PackageSymlink with a "fat" interface.
* Replaced File and Symlink by fat class LeafNode.
* Added Package* object management to Directory and LeafNode.
* Implemented packagefs_read_symlink(), so symlinks work now.
* Added some missing locking the kernel interface.


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


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

Work in progress:
* The FS parses package files from "/boot/common/packages" and builds an
node tree representation of the contained entries. Merging directories should
work. Lots of other stuff is missing yet, though.
* Implemented the hooks for directory entry lookup and iteration. So it's
possible to see the contents of the FS at least.


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


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

Implemented the most basic functionality required to cleanly mount and unmount
(at least in userlandfs).


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