Skip to content

Commit 9b72f1a

Browse files
authored
Merge pull request #1366 from cgwalters/two-minor
Two minor patches
2 parents a9f01fe + 76ec42b commit 9b72f1a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

contrib/packaging/bootc.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ cat >%{?buildroot}/%{system_reinstall_bootc_install_podman_path} <<EOF
121121
exec dnf -y install podman
122122
EOF
123123
chmod +x %{?buildroot}/%{system_reinstall_bootc_install_podman_path}
124-
# generate doc file list excluding directories
124+
# generate doc file list excluding directories; workaround for
125+
# https://github.com/coreos/rpm-ostree/issues/5420
125126
touch %{?buildroot}/%{_docdir}/bootc/baseimage/base/sysroot/.keepdir
126127
find %{?buildroot}/%{_docdir} ! -type d -printf '%{_docdir}/%%P\n' > bootcdoclist.txt
127128

ostree-ext/src/tar/export.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ impl<'a, W: std::io::Write> OstreeTarWriter<'a, W> {
640640
fn write_parents_of(
641641
&mut self,
642642
path: &Utf8Path,
643+
root: &gio::File,
643644
cache: &mut HashSet<Utf8PathBuf>,
644645
) -> Result<()> {
645646
let Some(parent) = path.parent() else {
@@ -654,15 +655,11 @@ impl<'a, W: std::io::Write> OstreeTarWriter<'a, W> {
654655
return Ok(());
655656
}
656657

657-
self.write_parents_of(parent, cache)?;
658+
self.write_parents_of(parent, root, cache)?;
658659

659660
let inserted = cache.insert(parent.to_owned());
660661
debug_assert!(inserted);
661662

662-
let root = self
663-
.repo
664-
.read_commit(&self.commit_checksum, gio::Cancellable::NONE)?
665-
.0;
666663
let parent_file = root.resolve_relative_path(unmap_path(parent).as_ref());
667664
let queryattrs = "unix::*";
668665
let queryflags = gio::FileQueryInfoFlags::NOFOLLOW_SYMLINKS;
@@ -733,13 +730,17 @@ fn write_chunk<W: std::io::Write>(
733730
create_parent_dirs: bool,
734731
) -> Result<()> {
735732
let mut cache = std::collections::HashSet::new();
733+
let root = writer
734+
.repo
735+
.read_commit(&writer.commit_checksum, gio::Cancellable::NONE)?
736+
.0;
736737
for (checksum, (_size, paths)) in chunk.into_iter() {
737738
let (objpath, h) = writer.append_content(checksum.borrow())?;
738739
for path in paths.iter() {
739740
let path = path_for_tar_v1(path);
740741
let h = h.clone();
741742
if create_parent_dirs {
742-
writer.write_parents_of(&path, &mut cache)?;
743+
writer.write_parents_of(&path, &root, &mut cache)?;
743744
}
744745
writer.append_content_hardlink(&objpath, h, path)?;
745746
}

0 commit comments

Comments
 (0)