Add system modification tracking for reversible installs

This commit is contained in:
lashman
2026-02-27 23:35:27 +02:00
parent 6e2e7e8e36
commit 8dd0dc71ed
9 changed files with 207 additions and 10 deletions

View File

@@ -312,7 +312,7 @@ fn cmd_integrate(db: &Database, path: &str) -> ExitCode {
return ExitCode::SUCCESS;
}
match integrator::integrate(&record) {
match integrator::integrate_tracked(&record, &db) {
Ok(result) => {
db.set_integrated(
record.id,
@@ -351,6 +351,7 @@ fn cmd_remove(db: &Database, path: &str) -> ExitCode {
return ExitCode::SUCCESS;
}
integrator::undo_all_modifications(&db, record.id).ok();
match integrator::remove_integration(&record) {
Ok(()) => {
db.set_integrated(record.id, false, None).ok();
@@ -858,7 +859,7 @@ fn cmd_import(db: &Database, file: &str) -> ExitCode {
// Need the full record to integrate
if let Ok(Some(record)) = db.get_appimage_by_id(id) {
if !record.integrated {
match integrator::integrate(&record) {
match integrator::integrate_tracked(&record, &db) {
Ok(result) => {
db.set_integrated(
id,