From 7658653aee9658ce30d99eb19038cace51f0103a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 12 Jun 2025 06:49:35 +0200 Subject: [PATCH 1/2] build-sys: Add a link to rpm-ostree issue Just to meke it easier to find. Signed-off-by: Colin Walters --- contrib/packaging/bootc.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/packaging/bootc.spec b/contrib/packaging/bootc.spec index 2db9d03f6..c0a202714 100644 --- a/contrib/packaging/bootc.spec +++ b/contrib/packaging/bootc.spec @@ -121,7 +121,8 @@ cat >%{?buildroot}/%{system_reinstall_bootc_install_podman_path} < bootcdoclist.txt From 76ec42bd9188a689e3ff6828b70901fb0db8875b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 12 Jun 2025 06:52:20 +0200 Subject: [PATCH 2/2] tar/export: Only load root once Minor optimization for previous commit. Signed-off-by: Colin Walters --- ostree-ext/src/tar/export.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ostree-ext/src/tar/export.rs b/ostree-ext/src/tar/export.rs index 744c42188..d22ca2c3e 100644 --- a/ostree-ext/src/tar/export.rs +++ b/ostree-ext/src/tar/export.rs @@ -640,6 +640,7 @@ impl<'a, W: std::io::Write> OstreeTarWriter<'a, W> { fn write_parents_of( &mut self, path: &Utf8Path, + root: &gio::File, cache: &mut HashSet, ) -> Result<()> { let Some(parent) = path.parent() else { @@ -654,15 +655,11 @@ impl<'a, W: std::io::Write> OstreeTarWriter<'a, W> { return Ok(()); } - self.write_parents_of(parent, cache)?; + self.write_parents_of(parent, root, cache)?; let inserted = cache.insert(parent.to_owned()); debug_assert!(inserted); - let root = self - .repo - .read_commit(&self.commit_checksum, gio::Cancellable::NONE)? - .0; let parent_file = root.resolve_relative_path(unmap_path(parent).as_ref()); let queryattrs = "unix::*"; let queryflags = gio::FileQueryInfoFlags::NOFOLLOW_SYMLINKS; @@ -733,13 +730,17 @@ fn write_chunk( create_parent_dirs: bool, ) -> Result<()> { let mut cache = std::collections::HashSet::new(); + let root = writer + .repo + .read_commit(&writer.commit_checksum, gio::Cancellable::NONE)? + .0; for (checksum, (_size, paths)) in chunk.into_iter() { let (objpath, h) = writer.append_content(checksum.borrow())?; for path in paths.iter() { let path = path_for_tar_v1(path); let h = h.clone(); if create_parent_dirs { - writer.write_parents_of(&path, &mut cache)?; + writer.write_parents_of(&path, &root, &mut cache)?; } writer.append_content_hardlink(&objpath, h, path)?; }