Skip to content

Commit

Permalink
when BUILD_MANIFEST_DISABLE_SIGNING is set, we don't need gpg-passwor…
Browse files Browse the repository at this point in the history
…d-file
  • Loading branch information
RalfJung committed Sep 14, 2019
1 parent 3287a65 commit ee83402
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,8 @@ impl Step for HashSign {
}

fn run(self, builder: &Builder<'_>) {
// This gets called by `promote-release`
// (https://github.com/rust-lang/rust-central-station/tree/master/promote-release).
let mut cmd = builder.tool_cmd(Tool::BuildManifest);
if builder.config.dry_run {
return;
Expand All @@ -2010,10 +2012,14 @@ impl Step for HashSign {
let addr = builder.config.dist_upload_addr.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.upload-addr` in `config.toml`\n\n")
});
let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
});
let pass = t!(fs::read_to_string(&file));
let pass = if env::var("BUILD_MANIFEST_DISABLE_SIGNING").is_err() {
let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
});
t!(fs::read_to_string(&file))
} else {
String::new()
};

let today = output(Command::new("date").arg("+%Y-%m-%d"));

Expand Down

0 comments on commit ee83402

Please sign in to comment.