Skip to content

Commit 2d0c090

Browse files
authored
Merge pull request #309 from alpinevm/master
Only codesign bitcoind if necessary
2 parents b6d31ec + dc4809e commit 2d0c090

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

node/build.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,26 @@ mod download {
160160
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
161161
{
162162
use std::process::Command;
163-
let status = Command::new("codesign")
164-
.arg("-s")
165-
.arg("-")
166-
.arg(existing_filename.to_str().unwrap())
163+
164+
let signing_status = Command::new("codesign")
165+
.arg("-v")
166+
.arg(&existing_filename)
167167
.status()
168-
.with_context(|| "failed to execute codesign")?;
169-
if !status.success() {
170-
return Err(anyhow::anyhow!(
171-
"codesign failed with exit code {}",
172-
status.code().unwrap_or(-1)
173-
));
168+
.with_context(|| "failed to verify bitcoind code signature")?;
169+
170+
if !signing_status.success() {
171+
let status = Command::new("codesign")
172+
.arg("-s")
173+
.arg("-")
174+
.arg(&existing_filename)
175+
.status()
176+
.with_context(|| "failed to sign bitcoind")?;
177+
if !status.success() {
178+
return Err(anyhow::anyhow!(
179+
"codesign failed with exit code {}",
180+
status.code().unwrap_or(-1)
181+
));
182+
}
174183
}
175184
}
176185
}

0 commit comments

Comments
 (0)