mirror of
https://github.com/fosskers/cargo-aur.git
synced 2026-03-11 17:34:53 -05:00
Strip the release binary before tarring it
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
# `cargo-aur` Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
#### Changed
|
||||
|
||||
- Run `strip` on the release binary before `tar`ring it.
|
||||
|
||||
## 1.1.1 (2020-08-11)
|
||||
|
||||
#### Fixed
|
||||
|
||||
@@ -154,6 +154,7 @@ fn tarball(musl: bool, package: &Package) -> anyhow::Result<()> {
|
||||
format!("target/release/{}", package.name)
|
||||
};
|
||||
|
||||
strip(&binary)?;
|
||||
fs::copy(binary, &package.name)?;
|
||||
Command::new("tar")
|
||||
.arg("czf")
|
||||
@@ -165,6 +166,13 @@ fn tarball(musl: bool, package: &Package) -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Strip the release binary, so that we aren't compressing more bytes than we
|
||||
/// need to.
|
||||
fn strip(path: &str) -> anyhow::Result<()> {
|
||||
Command::new("strip").arg(path).status()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn sha256sum(package: &Package) -> anyhow::Result<String> {
|
||||
let bytes = fs::read(package.tarball())?;
|
||||
let digest = Hash::hash(&bytes);
|
||||
|
||||
Reference in New Issue
Block a user