Skip to content

Commit

Permalink
Rollup merge of #39630 - alexcrichton:update-manifest, r=brson
Browse files Browse the repository at this point in the history
Rename manifest_version to manifest-version

The current manifests encode this with a dash in the name, so we should preserve
that!
  • Loading branch information
frewsxcv authored Feb 8, 2017
2 parents 09a2db5 + e53eaa3 commit 163f981
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
extern crate toml;
extern crate rustc_serialize;

use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};
use std::env;
use std::fs::File;
use std::io::{self, Read, Write};
Expand Down Expand Up @@ -95,7 +95,6 @@ static MINGW: &'static [&'static str] = &[
"x86_64-pc-windows-gnu",
];

#[derive(RustcEncodable)]
struct Manifest {
manifest_version: String,
date: String,
Expand Down Expand Up @@ -171,8 +170,18 @@ impl Builder {
self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu");

self.digest_and_sign();
let manifest = self.build_manifest();
let manifest = toml::encode(&manifest).to_string();
let Manifest { manifest_version, date, pkg } = self.build_manifest();

// Unfortunately we can't use derive(RustcEncodable) here because the
// version field is called `manifest-version`, not `manifest_version`.
// In lieu of that just create the table directly here with a `BTreeMap`
// and wrap it up in a `Value::Table`.
let mut manifest = BTreeMap::new();
manifest.insert("manifest-version".to_string(),
toml::encode(&manifest_version));
manifest.insert("date".to_string(), toml::encode(&date));
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);
Expand Down

0 comments on commit 163f981

Please sign in to comment.