Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GNU format tarballs to support longer paths #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ flate2 = "1.0.22"
openssl = { version = '0.10.41', optional = true }
serde = { version = "1.0.104", features = ['derive'] }
serde_json = "1.0.46"
tar = "0.4.26"
tar = "0.4.43"
url = "2.1.1"

[dev-dependencies]
Expand Down
10 changes: 2 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::fs::{self, File};
use std::io;
use std::io::prelude::*;
use std::path::{self, Path, PathBuf};
use tar::{Builder, Header};
use tar::Builder;
use url::Url;

#[derive(Deserialize)]
Expand Down Expand Up @@ -285,13 +285,7 @@ fn build_ar(ar: &mut Builder<GzEncoder<File>>, pkg: &Package, config: &GlobalCon
relative
);

let mut header = Header::new_ustar();
let metadata = file.metadata().unwrap();
header.set_path(&path).unwrap();
header.set_metadata(&metadata);
header.set_cksum();

ar.append(&header, &mut file).unwrap();
ar.append_file(&path, &mut file).unwrap();
}
}

Expand Down