haiku/headers/private/package/ActivationTransaction.h
Alexander G. M. Smith 3376ed1a72 Package Kit: Proper Installation for First Boot Packages
Do the final installation operations for all the packages in the
/system/packages directory when the OS is booted for the first time.

This will run their post-install scripts, create users, groups and generate
settings files (marked with a package version attribute).  Previously we just
ran all the shell scripts found in the /system/boot/post-install directory
(don't do that as much now).

Fixes bug #14382

This patch has simpler code flow in CommitTransactionHandler::_ApplyChanges
Tested on 32 and 64 bit systems.  Once it's official, need to remove the
open_ssh redundant post-install script that creates users etc. from HaikuPorts.
Now we can notice bugs like package version attributes on settings files aren't
fully working. :-)

Didn't remove special case for add_catalog_entry_attributes.sh since it
still does stuff that the build system doesn't do.  Might be able to add
that script as part of the Haiku.hpkg.  See change 3751 for removing it,
https://review.haiku-os.org/c/haiku/+/3751

Change-Id: I3807b78042fdb70e5a79eca2e2a45816ece0236f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2342
Reviewed-by: Alexander G. M. Smith <agmsmith@ncf.ca>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-14 09:10:18 +00:00

81 lines
2.1 KiB
C++

/*
* Copyright 2013, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold <ingo_weinhold@gmx.de>
*/
#ifndef _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
#define _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
#include <Archivable.h>
#include <package/PackageDefs.h>
#include <StringList.h>
namespace BPackageKit {
namespace BPrivate {
class BActivationTransaction : public BArchivable {
public:
BActivationTransaction();
BActivationTransaction(BMessage* archive,
status_t* _error = NULL);
virtual ~BActivationTransaction();
status_t SetTo(BPackageInstallationLocation location,
int64 changeCount,
const BString& directoryName);
status_t InitCheck() const;
BPackageInstallationLocation Location() const;
void SetLocation(
BPackageInstallationLocation location);
int64 ChangeCount() const;
void SetChangeCount(int64 changeCount);
const BString& TransactionDirectoryName() const;
void SetTransactionDirectoryName(
const BString& directoryName);
const BStringList& PackagesToActivate() const;
bool SetPackagesToActivate(
const BStringList& packages);
bool AddPackageToActivate(const BString& package);
const BStringList& PackagesToDeactivate() const;
bool SetPackagesToDeactivate(
const BStringList& packages);
bool AddPackageToDeactivate(const BString& package);
bool FirstBootProcessing() const;
void SetFirstBootProcessing(bool processingIsOn);
virtual status_t Archive(BMessage* archive,
bool deep = true) const;
static BArchivable* Instantiate(BMessage* archive);
private:
static status_t _ExtractStringList(BMessage* archive,
const char* field, BStringList& _list);
private:
BPackageInstallationLocation fLocation;
int64 fChangeCount;
BString fTransactionDirectoryName;
BStringList fPackagesToActivate;
BStringList fPackagesToDeactivate;
bool fFirstBootProcessing;
};
} // namespace BPrivate
} // namespace BPackageKit
#endif // _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_