Skip to content

Commit

Permalink
Invert check of BSSL_GIT_NO_CHECKOUT (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdygert-spok authored Jul 17, 2023
1 parent 996932f commit 81256f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ jobs:
with:
gh-token: ${{ secrets.CC_BUILD_TOKEN }}
- name: Build code
run: cargo build --verbose
run: cargo build --verbose --release
35 changes: 16 additions & 19 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,25 +433,22 @@ fn find_bssl_sources() -> Result<Sources> {
}

println!("cargo:rerun-if-env-changed={BSSL_GIT_NO_CHECKOUT_VAR}");
match env::var(BSSL_GIT_NO_CHECKOUT_VAR) {
Ok(v) if v == "1" => {
// Make sure we're at the correct commit.
Command::new("git")
.arg("reset")
.arg("--hard")
.arg("head")
.current_dir(&path)
.status()?
.exit_ok()?;
let hash = env::var(BSSL_GIT_HASH_VAR).unwrap_or(BSSL_GIT_HASH.to_owned());
Command::new("git")
.arg("checkout")
.arg(hash)
.current_dir(&path)
.status()?
.exit_ok()?;
}
_ => {}
if env::var(BSSL_GIT_NO_CHECKOUT_VAR).as_deref() != Ok("1") {
// Make sure we're at the correct commit.
Command::new("git")
.arg("reset")
.arg("--hard")
.arg("HEAD")
.current_dir(&path)
.status()?
.exit_ok()?;
let hash = env::var(BSSL_GIT_HASH_VAR).unwrap_or(BSSL_GIT_HASH.to_owned());
Command::new("git")
.arg("checkout")
.arg(hash)
.current_dir(&path)
.status()?
.exit_ok()?;
}
Ok(Sources::Raw(path))
}
Expand Down

0 comments on commit 81256f5

Please sign in to comment.