Skip to content

Commit

Permalink
composepost: Normalize rpmdb.sqlite-shm
Browse files Browse the repository at this point in the history
In some testing I have using `SOURCE_DATE_EPOCH=0`, this file
is now the only thing that differs across builds.
  • Loading branch information
cgwalters committed Oct 4, 2022
1 parent ff6a16c commit e7e91ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rust/src/composepost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down

0 comments on commit e7e91ee

Please sign in to comment.