diff --git a/Cargo.toml b/Cargo.toml index d49afd92..bbd6893b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,6 @@ opt-level = 1 # No optimizations are too slow for us. [profile.release] lto = "thin" + +[patch.crates-io] +tar = { path = "../../alexcrichton/tar-rs" } diff --git a/lib/src/tar/export.rs b/lib/src/tar/export.rs index 2cfadda9..ff9721a6 100644 --- a/lib/src/tar/export.rs +++ b/lib/src/tar/export.rs @@ -231,13 +231,11 @@ impl<'a, W: std::io::Write> OstreeTarWriter<'a, W> { .append_data(&mut h, &path, &mut instream) .with_context(|| format!("Writing regfile {}", checksum))?; } else { - h.set_size(0); - h.set_entry_type(tar::EntryType::Symlink); let context = || format!("Writing content symlink: {}", checksum); - h.set_link_name(meta.symlink_target().unwrap().as_str()) - .with_context(context)?; + h.set_entry_type(tar::EntryType::Symlink); + h.set_size(0); self.out - .append_data(&mut h, &path, &mut std::io::empty()) + .append_link(&mut h, &path, meta.symlink_target().unwrap().as_str()) .with_context(context)?; } }