History log of /haiku/src/kits/package/PackageInfoContentHandler.cpp
Revision Date Author Comments
# 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>


# 31d70c10 13-Aug-2019 Alexander G. M. Smith <agmsmith@ncf.ca>

package kit: Skip over future package attributes.

Ignore unknown fields (also called attributes) which are from a package
file with a different minor version number. Previously it would halt
with an error when encountering such a field, even though it can safely
be skipped over (if it was unsafe, we would have incremented the major
version number).

The use case is a future package attribute for pre-uninstall scripts.
If they're not run, that just leaves some debris after uninstalling
(like symbolic link desktop icons).

* Use the B_NOT_SUPPORTED error code when reading unknown package
attributes. Don't treat it as an error if the package is a
different minor version, just skip it.
* Print unknown package attribute index numbers rather than stopping,
since they may be from future package file formats and can be safely
skipped otherwise. Mention the relevant enum so you can find it in
the source code. It's a pity that the previous abstraction layer
isn't present, since it tells us what data type the attribute is
(string, number, etc), so we could have printed its value too.

First step of two for enhancement #13427

See https://review.haiku-os.org/c/haiku/+/1504 to generate packages
with a different minor version number (second step of the enhancement).

Change-Id: I6db1897824a1713b3d5fab6fdfb990ee5923cd52
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1714
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# dfbf1c8a 02-Aug-2019 Augustin Cavalier <waddlesplash@gmail.com>

Package Kit: Avoid discarding potential error values.

Spotted by Clang and the [[nodiscard]] patch.


# 4489c88b 05-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

hpkg format: Generalize user/global settings file attributes

* For all identifiers: Rename global settings file to global writable
file. We want to use the respective attribute also for other writable
files, not only settings files.
* User settings file/global writable file info/attribute: Add
isDirectory property/child attribute. This allows declaring global/
user settings directories associated with the package.


# 56b43eca 27-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageInfoContentHandler: Handle new attributes

Also add respective *Data constructors to BUser, BUserSettingsFileInfo,
and BGlobalSettingsFileInfo.


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

Add class BPackageInfoContentHandler

A BPackageContentHandler subclass that initializes a BPackageInfo from
the read package attributes. Pulled out of RepositoryWriterImpl's
PackageContentHandler.


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

Add class BPackageInfoContentHandler

A BPackageContentHandler subclass that initializes a BPackageInfo from
the read package attributes. Pulled out of RepositoryWriterImpl's
PackageContentHandler.


# 4489c88b61bd4b70ff3a91d24ef5a0088e9c4691 05-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

hpkg format: Generalize user/global settings file attributes

* For all identifiers: Rename global settings file to global writable
file. We want to use the respective attribute also for other writable
files, not only settings files.
* User settings file/global writable file info/attribute: Add
isDirectory property/child attribute. This allows declaring global/
user settings directories associated with the package.


# 56b43eca036445983248a14b9c5343518d3cccb3 27-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BPackageInfoContentHandler: Handle new attributes

Also add respective *Data constructors to BUser, BUserSettingsFileInfo,
and BGlobalSettingsFileInfo.


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

Add class BPackageInfoContentHandler

A BPackageContentHandler subclass that initializes a BPackageInfo from
the read package attributes. Pulled out of RepositoryWriterImpl's
PackageContentHandler.


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

Add class BPackageInfoContentHandler

A BPackageContentHandler subclass that initializes a BPackageInfo from
the read package attributes. Pulled out of RepositoryWriterImpl's
PackageContentHandler.