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 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)?; }