Skip to content

Commit

Permalink
Rollup merge of #40225 - shepmaster:restore-build-date-file, r=alexcr…
Browse files Browse the repository at this point in the history
…ichton

Restore creating the channel-rust-$channel-date.txt files

I have **not** run this (because I don't know how to 😇), but it *does* compile.

r? @alexcrichton
  • Loading branch information
frewsxcv authored Mar 3, 2017
2 parents 478b8e2 + b601b75 commit 4f930fc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,19 @@ impl Builder {
let mut manifest = BTreeMap::new();
manifest.insert("manifest-version".to_string(),
toml::Value::String(manifest_version));
manifest.insert("date".to_string(), toml::Value::String(date));
manifest.insert("date".to_string(), toml::Value::String(date.clone()));
manifest.insert("pkg".to_string(), toml::encode(&pkg));
let manifest = toml::Value::Table(manifest).to_string();

let filename = format!("channel-rust-{}.toml", self.channel);
self.write_manifest(&manifest, &filename);

let filename = format!("channel-rust-{}-date.txt", self.channel);
self.write_date_stamp(&date, &filename);

if self.channel != "beta" && self.channel != "nightly" {
self.write_manifest(&manifest, "channel-rust-stable.toml");
self.write_date_stamp(&date, "channel-rust-stable-date.txt");
}
}

Expand Down Expand Up @@ -408,4 +412,11 @@ impl Builder {
self.hash(&dst);
self.sign(&dst);
}

fn write_date_stamp(&self, date: &str, name: &str) {
let dst = self.output.join(name);
t!(t!(File::create(&dst)).write_all(date.as_bytes()));
self.hash(&dst);
self.sign(&dst);
}
}

0 comments on commit 4f930fc

Please sign in to comment.