Skip to content

Commit

Permalink
Use new append_link() API to handle long symlinks
Browse files Browse the repository at this point in the history
I hit this when exporting Fedora Silverblue, there are some
long symlinks in there.

Depends: alexcrichton/tar-rs#273
Closes: ostreedev#162
  • Loading branch information
cgwalters committed Dec 14, 2021
1 parent 6c5e53e commit 39d4b93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Expand Up @@ -35,7 +35,7 @@ pin-project = "1.0"
serde = { features = ["derive"], version = "1.0.125" }
serde_json = "1.0.64"
structopt = "0.3.21"
tar = "0.4.33"
tar = "0.4.38"
tempfile = "3.2.0"
tokio = { features = ["full"], version = "1" }
tokio-util = { features = ["io-util"], version = "0.6.9" }
Expand Down
8 changes: 3 additions & 5 deletions lib/src/tar/export.rs
Expand Up @@ -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)?;
}
}
Expand Down

0 comments on commit 39d4b93

Please sign in to comment.