History log of /haiku/src/kits/package/DaemonClient.cpp
Revision Date Author Comments
# cd6365c7 17-May-2018 Jérôme Duval <jerome.duval@gmail.com>

style fixes


# 6262ccbb 18-Aug-2016 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix use of findpaths from inside chroot

The package kit needs to provide the package daemon with the node_ref of
the root directory, so the package daemon gives the correct results when
the request comes from inside a chroot.

Moreover, the package kit must be able to handle a root with a system
but no home package dir, as is the case inside the chroot environment
created by haikuporter.

Fixes #12602.


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


# e9eb4df7 05-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BDaemonClient: Handle options message fields correctly


# 4284b6c9 02-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BInstallationLocationInfo: Provide more info

* If the active state is not the latest state, also provide a package
set for it.
* If an old state has been booted, provide its name.


# 5a1c6a70 01-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

InstallationLocation: Rename [in]activePackages properties

Add prefix "Latest".


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


# df266f1c 21-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BDaemonClient::CommitTransaction(): Align with documentation

The method is supposed to return B_OK as long as the _result object has
been initialized, even if committing the transaction failed. Fixes the
unhelpful error messages of pkgman when committing the transaction
failed for some reason.


# 56b13760 10-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BActivationTransaction: Make BArchivable


# 6a143071 20-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BDaemonClient: Add support for creating activation transactions

* BActivationTransaction:
- Remove non-trivial constructor.
- Remove package list parameters from SetTo().
- Add AddPackageTo{Dea,A}ctivate().
* BDaemonClient:
- Add CreateTransaction(). It creates a transaction directory and
initializes a BActivationTransaction. Packages to de-/activate have
to be added afterwards.
- Add BCommitTransactionResult::FullErrorMessage().


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


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

Fix BMessage::GetInfo() return value check

Since B_OK is 0, the change doesn't affect the semantics.


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


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


# e9eb4df71b2449801d45609cc84d7ab2947a0a27 05-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BDaemonClient: Handle options message fields correctly


# 4284b6c93ad90effc93057772d6e4595043cbf3d 02-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BInstallationLocationInfo: Provide more info

* If the active state is not the latest state, also provide a package
set for it.
* If an old state has been booted, provide its name.


# 5a1c6a7089489ff556bb69b392c64dd370802ac1 01-May-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

InstallationLocation: Rename [in]activePackages properties

Add prefix "Latest".


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


# df266f1c937e51c1309e70e77264585b7ba0ce83 21-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BDaemonClient::CommitTransaction(): Align with documentation

The method is supposed to return B_OK as long as the _result object has
been initialized, even if committing the transaction failed. Fixes the
unhelpful error messages of pkgman when committing the transaction
failed for some reason.


# 56b1376090192c61ea7b681c3db8c6bce54228fe 10-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BActivationTransaction: Make BArchivable


# 6a1430716c8746b3a044bb65fb1849e906ae0453 20-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BDaemonClient: Add support for creating activation transactions

* BActivationTransaction:
- Remove non-trivial constructor.
- Remove package list parameters from SetTo().
- Add AddPackageTo{Dea,A}ctivate().
* BDaemonClient:
- Add CreateTransaction(). It creates a transaction directory and
initializes a BActivationTransaction. Packages to de-/activate have
to be added afterwards.
- Add BCommitTransactionResult::FullErrorMessage().


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


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

Fix BMessage::GetInfo() return value check

Since B_OK is 0, the change doesn't affect the semantics.


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