History log of /haiku/src/servers/package/Volume.h
Revision Date Author Comments
# f32d5c5c 03-Jul-2021 Andrew Lindesay <apl@lindesay.co.nz>

Packages: signal added|removed packages

Update the package server so that it reports the
added and removed packages when it commits a
change so that clients are able to pickup and
act on the changes without iterating over all of
the packages.

Change-Id: I6feb52c34fc51a78e2282d8d5ca6cb6775b221ca
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4141
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# a22fa0c9 04-Jun-2019 Alexander G. M. Smith <agmsmith@ncf.ca>

package kit: Add pre-uninstall scripts feature.

Just like post-install scripts which run shortly after a package is
installed, pre-uninstall scripts are run just before a package is
removed. Implements enhancement #13427

* Fix script exit code handling vs script launch errors.
* Bump package and repo file version numbers due to new attribute,
unfortunately makes new .hpkg files not backwards compatible.
* Add pre-uninstall functionality, mostly cloning the post-install
except in a few places.
* Discover that _RunQueuedScripts() is never called, a future TODO:?
* Update package documentation for pre-uninstall scripts, and use of
the boot/post-install directory.

Change-Id: I45596255ce74bc102f6e5b606cbf83e4e4347a17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1504
Reviewed-by: Alexander G. M. Smith <agmsmith@ncf.ca>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 6f19d31c 13-Jun-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

package_daemon: queue post-install scripts to run after reboot

* Creates symlinks to the post-install scripts into the
administrative/queued-scripts directory.
* Upon reboot, post-install scripts in the queued-scripts
are run, and then the symlinks to the scripts removed.
* This solves the issue of post-install scripts not being
run when the package is installed/upgraded along with the
system packages, as experienced with the latest upgrade
to the bash package.


# 0de3219e 14-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Rework error and issue propagation to client

* BDaemonClient: Move inner class BCommitTransactionResult to top level
and make it public.
* BCommitTransactionResult:
- Add a whole bunch of specific error code enum values. Such an error
code is now the primary error, as opposed to before where we would
mix status_t and enum value errors. There's a systemError property
of type status_t which may provide additional information, though
(depending on the primary error type).
- Remove the errorMessage property. Due to mapping all errors to the
specific error codes this is no longer necessary. Mixing such a
message with another error description is also not very helpful when
it comes to localization (still not supported, though).
- Add several properties (paths, strings, error codes) that serve as
arguments to the primary error and are used by FullErrorMessage().
- Add issues property, a list of instances of new class
BTransactionIssue. Those describe non-critical issues (e.g. failed
update of a settings file) that occurred in the process of
committing the transaction. Those issues should be presented to the
user by the package management program.
* Exception: Adjust to transport the BCommitTransactionResult
properties.
* CommitTransactionHandler, FsTransactions, Root, Volume: Adjust to
BCommitTransactionResult/Exception changes.
* CommitTransactionHandler: Now requires a BCommitTransactionResult to
which it adds the issues it encounters. The reply BMessage is no
longer needed, though.
* Volume: Refactor common code from the three methods that use
CommitTransactionHandler into new method _CommitTransaction.


# 870e93ac 01-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Move volume change counter back to Volume


# 2dbf8167 27-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Initial old packages state support

* VolumeState: Move locking to Volume.
* Package: Pull the file related functionality into new class
PackageFile. A Package refers to a PackageFile. A PackageFile can be
referenced by multiple Packages. PackageFiles are managed by the new
PackageFileManager.
* CommitTransactionHandler: Clone the passed volume state.
* Volume now manages two VolumeStates: A state reflecting the currently
active packages and the latest state (i.e. the one reflecting the
situation of the packages directory). Usually the two are the same,
unless an old state has been booted.
* The client interface hasn't been adjusted yet. Clients only see the
latest state.


# c8dd5bbd 22-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Retrieve all package directories from packagefs


# 7a3253f0 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Pass volume state CommitTransactionHandler

... and remove the getter from Volume again.


# 7a35d803 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Move pending job accounting back to Volume


# 8c6e1bf5 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Sever Volume-CommitTransactionHandler friendship

Move quite a bit of transaction related methods from Volume to
CommitTransactionHandler.


# 933e7b32 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Move Volume::CommitTransactionHandler to top level

Also move constant definitions to Constants.h/cpp.


# 273763d0 19-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Move Volume::State to top level

... and rename it to VolumeState.


# 32cae724 06-Feb-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Handle location info request in app thread

* ... instead of queuing it for the job thread. The advantage is that
the request will be handled immediately and clients won't have to wait
for transactions (which may even require user feedback) to finish. It
complicates Volume a bit, since there are now two threads that may
access it. The shared data have been moved to a State object which is
protected by a lock.
* For commit transaction requests check whether another package request
is already pending/in progress before queuing a job. Fail immediately,
if there is.

Fixes bug #10039.


# f73f5d4c 29-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Initial changes to remove /boot/common

* find_directory() and hard-coded paths use /boot/system instead of
/boot/common.
* The build system creates the writable directories in /boot/system
instead of /boot/common.
* The build system no longer installs any packages in /boot/common.


# 23733521 26-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Implement writable files handling

* Move Volume::Exception to top level and into own files.
* Add utility class FSUtils, move Volume::RelativePath there and add a
bunch of FS utility functionality.
* Add FSTransaction, a helper class to record FS operations and revert
them.
* When activating a package we now extract the writable
files/directories it declares. The handling is not quite complete:
- We don't handle merges yet. I.e. the user will have to do that
manually for now.
- We don't propagate issues/infos regarding the writable files (e.g.
that a manual intervention is required) to the user yet.


# 38c62dfb 10-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Implement dependency resolution support

... for package changes performed manually by the user (i.e.
adding/removing files in a packages directory). Currently only done for
the system root. Alternative roots should still work as before, so this
shouldn't affect haikuporter (not tested yet).

Needs some more work (e.g. the GUI part).


# 85d2badf 19-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Add support for activation change request

* daemon: Handle new request B_MESSAGE_COMMIT_TRANSACTION. It activates
and deactivates given sets of packages. The new packages must be
placed in a directory in the administrative directory. The daemon
moves them to the packages directory and the deactivated packages to
a subdirectory it creates. It also save the old activation state
there.
* Add private BActivationTransaction, describing an activation change
transaction.
* BDaemonClient: Add CommitTransaction(), which sends a given
BActivationTransaction as a B_MESSAGE_COMMIT_TRANSACTION request to
the daemon.

Completely untested yet.


# e6216e37 14-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Implement getting a BInstallationLocationInfo

* Rename PackageDaemonDefs.h to DaemonDefs.h.
* Replace the MESSAGE_GET_PACKAGES by the new
B_MESSAGE_GET_INSTALLATION_LOCATION_INFO, which not only returns the
packages, but also other information about the installation location.
* daemon: Volume: Implement a change count which is bumped whenever
packages are activated/deactivated/added/removed. Cache the reply
for a location info request, using the change count to check whether
it is still up-to-date.
* Add private BDaemonClient for communication with the daemon.
* BRoster:
- Add GetInstallationLocationInfo() using BDaemonClient.
- Reimplement GetActivePackages(), using
GetInstallationLocationInfo().


# 62f7022a 10-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: get active packages list from daemon

* daemon: Implement private message protocol to retrieve the active
packages.
* BPackageRoster::GetActivePackages(): Get the active packages list
from the daemon.


# b254217a 10-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Properly qualify private package headers

... instead of adding the private package header directory to the
include paths.


# a96531fc 09-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: On changes write a file with the active packages


# 92b6d585 09-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Check volume package dependencies initially

Dumps the result (i.e. found problems and solutions) to the syslog.
Eventually the user should be asked what to do when inconsistencies are
encountered.


# a6c7f5e3 08-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: De/-activate all changed packages together

* We first process the node monitoring events, collecting the required
package activation changes, then apply all changes together.
* Change the PackageFSActivationChangeItem/-Request structs. The former
is no longer variable in size, which makes it easier to work with.


# 9e409614 08-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Add a Listener interface for Volume

* This way, Volume doesn't have to know Root.
* Suppress listener notifications for node monitoring events when there
are were already events pending.


# 8fb3930a 07-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Make all work with the packages asynchronous

There's now a worker thread per Root that does all the work that can
take time. Node monitoring notifications received in the main thread are
just pushed into the worker's job queue, so the application looper
remains responsive.


# 3d53bd47 06-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Add package monitoring and de-/activation

* packagefs: Disable (comment out) node monitoring of the packages
directory.
* package daemon:
- When a packagefs volume is added load the respective packages
directory and get from the volume which of the packages are
activated.
- Add node monitoring for the packages directory and
activate/deactivate packages as packages are added/removed.


# 26296b0a 05-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add the humble beginnings of the package daemon

It doesn't really do anything yet save for tracking what packagefs
volumes are mounted and unmounted.


# 6f19d31cd4d8fda1e85d5a2ab8717263c9b84f34 13-Jun-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

package_daemon: queue post-install scripts to run after reboot

* Creates symlinks to the post-install scripts into the
administrative/queued-scripts directory.
* Upon reboot, post-install scripts in the queued-scripts
are run, and then the symlinks to the scripts removed.
* This solves the issue of post-install scripts not being
run when the package is installed/upgraded along with the
system packages, as experienced with the latest upgrade
to the bash package.


# 0de3219e339506a0c94b584a0df0287414437033 14-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Rework error and issue propagation to client

* BDaemonClient: Move inner class BCommitTransactionResult to top level
and make it public.
* BCommitTransactionResult:
- Add a whole bunch of specific error code enum values. Such an error
code is now the primary error, as opposed to before where we would
mix status_t and enum value errors. There's a systemError property
of type status_t which may provide additional information, though
(depending on the primary error type).
- Remove the errorMessage property. Due to mapping all errors to the
specific error codes this is no longer necessary. Mixing such a
message with another error description is also not very helpful when
it comes to localization (still not supported, though).
- Add several properties (paths, strings, error codes) that serve as
arguments to the primary error and are used by FullErrorMessage().
- Add issues property, a list of instances of new class
BTransactionIssue. Those describe non-critical issues (e.g. failed
update of a settings file) that occurred in the process of
committing the transaction. Those issues should be presented to the
user by the package management program.
* Exception: Adjust to transport the BCommitTransactionResult
properties.
* CommitTransactionHandler, FsTransactions, Root, Volume: Adjust to
BCommitTransactionResult/Exception changes.
* CommitTransactionHandler: Now requires a BCommitTransactionResult to
which it adds the issues it encounters. The reply BMessage is no
longer needed, though.
* Volume: Refactor common code from the three methods that use
CommitTransactionHandler into new method _CommitTransaction.


# 870e93acf88329489473abf19e0471454ff9dd2e 01-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Move volume change counter back to Volume


# 2dbf8167fec7282ac384273014903a1bbdfa49e6 27-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Initial old packages state support

* VolumeState: Move locking to Volume.
* Package: Pull the file related functionality into new class
PackageFile. A Package refers to a PackageFile. A PackageFile can be
referenced by multiple Packages. PackageFiles are managed by the new
PackageFileManager.
* CommitTransactionHandler: Clone the passed volume state.
* Volume now manages two VolumeStates: A state reflecting the currently
active packages and the latest state (i.e. the one reflecting the
situation of the packages directory). Usually the two are the same,
unless an old state has been booted.
* The client interface hasn't been adjusted yet. Clients only see the
latest state.


# c8dd5bbd9427cd219a880b00c6f077888a3df6ce 22-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Retrieve all package directories from packagefs


# 7a3253f07c1268b15f6a16bf15cb0a8607ade304 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Pass volume state CommitTransactionHandler

... and remove the getter from Volume again.


# 7a35d803d00c1e363c41dca1802be1dd24a404ea 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Move pending job accounting back to Volume


# 8c6e1bf54868b11ec9df027700858e36cb421ac0 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Sever Volume-CommitTransactionHandler friendship

Move quite a bit of transaction related methods from Volume to
CommitTransactionHandler.


# 933e7b3280f1d1ed01b4080288fbe767a2d18379 20-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Move Volume::CommitTransactionHandler to top level

Also move constant definitions to Constants.h/cpp.


# 273763d052bcb49a153fd8b434006cce9a0fbe63 19-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Move Volume::State to top level

... and rename it to VolumeState.


# 32cae72412f4e1503d124ee00a09832022a4840f 06-Feb-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Handle location info request in app thread

* ... instead of queuing it for the job thread. The advantage is that
the request will be handled immediately and clients won't have to wait
for transactions (which may even require user feedback) to finish. It
complicates Volume a bit, since there are now two threads that may
access it. The shared data have been moved to a State object which is
protected by a lock.
* For commit transaction requests check whether another package request
is already pending/in progress before queuing a job. Fail immediately,
if there is.

Fixes bug #10039.


# f73f5d4c42a01ece688cbb57b5d332cc0f68b2c6 29-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Initial changes to remove /boot/common

* find_directory() and hard-coded paths use /boot/system instead of
/boot/common.
* The build system creates the writable directories in /boot/system
instead of /boot/common.
* The build system no longer installs any packages in /boot/common.


# 23733521a7b2d6c16027654c606c6069ef026357 26-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Implement writable files handling

* Move Volume::Exception to top level and into own files.
* Add utility class FSUtils, move Volume::RelativePath there and add a
bunch of FS utility functionality.
* Add FSTransaction, a helper class to record FS operations and revert
them.
* When activating a package we now extract the writable
files/directories it declares. The handling is not quite complete:
- We don't handle merges yet. I.e. the user will have to do that
manually for now.
- We don't propagate issues/infos regarding the writable files (e.g.
that a manual intervention is required) to the user yet.


# 38c62dfb8b5acffe9373b19e087d037d38a281a5 10-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Implement dependency resolution support

... for package changes performed manually by the user (i.e.
adding/removing files in a packages directory). Currently only done for
the system root. Alternative roots should still work as before, so this
shouldn't affect haikuporter (not tested yet).

Needs some more work (e.g. the GUI part).


# 85d2badf007cb152215485db7916578ed6700504 19-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Add support for activation change request

* daemon: Handle new request B_MESSAGE_COMMIT_TRANSACTION. It activates
and deactivates given sets of packages. The new packages must be
placed in a directory in the administrative directory. The daemon
moves them to the packages directory and the deactivated packages to
a subdirectory it creates. It also save the old activation state
there.
* Add private BActivationTransaction, describing an activation change
transaction.
* BDaemonClient: Add CommitTransaction(), which sends a given
BActivationTransaction as a B_MESSAGE_COMMIT_TRANSACTION request to
the daemon.

Completely untested yet.


# e6216e372af01cc90339fe7afb70c113c99974bd 14-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Implement getting a BInstallationLocationInfo

* Rename PackageDaemonDefs.h to DaemonDefs.h.
* Replace the MESSAGE_GET_PACKAGES by the new
B_MESSAGE_GET_INSTALLATION_LOCATION_INFO, which not only returns the
packages, but also other information about the installation location.
* daemon: Volume: Implement a change count which is bumped whenever
packages are activated/deactivated/added/removed. Cache the reply
for a location info request, using the change count to check whether
it is still up-to-date.
* Add private BDaemonClient for communication with the daemon.
* BRoster:
- Add GetInstallationLocationInfo() using BDaemonClient.
- Reimplement GetActivePackages(), using
GetInstallationLocationInfo().


# 62f7022a8294bbd5407826c0bb8b071975ed90d5 10-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: get active packages list from daemon

* daemon: Implement private message protocol to retrieve the active
packages.
* BPackageRoster::GetActivePackages(): Get the active packages list
from the daemon.


# b254217a09a45fe317ae8b8e9ad9a8ddfc3df4b0 10-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Properly qualify private package headers

... instead of adding the private package header directory to the
include paths.


# a96531fc511e210c34cb054310b61b560a82a06c 09-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: On changes write a file with the active packages


# 92b6d58598fb09b38150027f6cbfa38fd5fb53e6 09-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Check volume package dependencies initially

Dumps the result (i.e. found problems and solutions) to the syslog.
Eventually the user should be asked what to do when inconsistencies are
encountered.


# a6c7f5e33c2a4e8596b2901d2fbecdd579d47b36 08-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: De/-activate all changed packages together

* We first process the node monitoring events, collecting the required
package activation changes, then apply all changes together.
* Change the PackageFSActivationChangeItem/-Request structs. The former
is no longer variable in size, which makes it easier to work with.


# 9e4096146fa5a20df2fc06301683853029851163 08-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Add a Listener interface for Volume

* This way, Volume doesn't have to know Root.
* Suppress listener notifications for node monitoring events when there
are were already events pending.


# 8fb3930a4290eb1156bbe53fba7947b0cd2be237 07-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Make all work with the packages asynchronous

There's now a worker thread per Root that does all the work that can
take time. Node monitoring notifications received in the main thread are
just pushed into the worker's job queue, so the application looper
remains responsive.


# 3d53bd473b49aa91a9611dfe6500492500e1e8c6 06-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package daemon: Add package monitoring and de-/activation

* packagefs: Disable (comment out) node monitoring of the packages
directory.
* package daemon:
- When a packagefs volume is added load the respective packages
directory and get from the volume which of the packages are
activated.
- Add node monitoring for the packages directory and
activate/deactivate packages as packages are added/removed.


# 26296b0aa4ddcc1b8baf1e6c380d0f8634730068 05-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add the humble beginnings of the package daemon

It doesn't really do anything yet save for tracking what packagefs
volumes are mounted and unmounted.