Package Kit, pkgman, SoftwareUpdater: Offer to delete old state directories.
This adds a new job to the Package Kit, and an invocation in pkgman after changes are applied. The job takes a time_t before, and an int32 minToKeep, and (after confirmation) deletes all state directories which were last modified before that time, but also keeps at least the minimum specified. pkgman defaults to calling it with (now - 30 days, minimum 10). SoftwareUpdater does the same, but without bothering the user and just defaults to doing the cleanup. Change-Id: I15f5232b11daba5955e7fa07f696ad7785507931 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10404 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
79ab5081b2
commit
5f0f0b02b4
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2026, Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__CLEAN_UP_ADMIN_DIR_REQUEST_H_
|
||||
#define _PACKAGE__CLEAN_UP_ADMIN_DIR_REQUEST_H_
|
||||
|
||||
|
||||
#include <String.h>
|
||||
|
||||
#include <package/Context.h>
|
||||
#include <package/Request.h>
|
||||
#include <package/InstallationLocationInfo.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class CleanUpAdminDirectoryRequest : public BRequest {
|
||||
typedef BRequest inherited;
|
||||
|
||||
public:
|
||||
CleanUpAdminDirectoryRequest(const BContext& context,
|
||||
const BInstallationLocationInfo& location,
|
||||
time_t cleanupBefore, int32 minStatesToKeep);
|
||||
virtual ~CleanUpAdminDirectoryRequest();
|
||||
|
||||
virtual status_t CreateInitialJobs();
|
||||
|
||||
private:
|
||||
const BInstallationLocationInfo fLocationInfo;
|
||||
time_t fCleanupBefore;
|
||||
int32 fMinimumStatesToKeep;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__CLEAN_UP_ADMIN_DIR_REQUEST_H_
|
||||
Reference in New Issue
Block a user