From e7e91ee31de93a1423995430f2fe6be60bb346a7 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 4 Oct 2022 09:11:56 -0400 Subject: [PATCH] composepost: Normalize `rpmdb.sqlite-shm` In some testing I have using `SOURCE_DATE_EPOCH=0`, this file is now the only thing that differs across builds. --- rust/src/composepost.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust/src/composepost.rs b/rust/src/composepost.rs index 0ba09bbaf0..414f590595 100644 --- a/rust/src/composepost.rs +++ b/rust/src/composepost.rs @@ -274,6 +274,11 @@ fn postprocess_cleanup_rpmdb_impl(rootfs_dfd: &Dir) -> Result<()> { if matches!(name, ".dbenv.lock" | ".rpm.lock") || name.starts_with("__db.") { d.remove_file(name)?; } + // SQLite case. Today, it seems to work to remove the WAL, but removing the SHM + // file causes a runtime error as RPM tries to mutate a read-only database. + if matches!(name, "rpmdb.sqlite-shm" | "rpmdb.sqlite-wal") { + d.write(name, b"")?; + } } Ok(()) }