Skip to content

Commit

Permalink
Use time crate in bootstrap dist instead of date
Browse files Browse the repository at this point in the history
  • Loading branch information
onur committed Feb 5, 2018
1 parent 07ea260 commit 1461d12
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ serde_derive = "1.0.8"
serde_json = "1.0.2"
toml = "0.4"
lazy_static = "0.2"
time = "0.1"
6 changes: 3 additions & 3 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use builder::{Builder, RunConfig, ShouldRun, Step};
use compile;
use tool::{self, Tool};
use cache::{INTERNER, Interned};
use time;

pub fn pkgname(build: &Build, component: &str) -> String {
if component == "cargo" {
Expand Down Expand Up @@ -445,8 +446,7 @@ impl Step for Rustc {
t!(fs::create_dir_all(image.join("share/man/man1")));
let man_src = build.src.join("src/doc/man");
let man_dst = image.join("share/man/man1");
let date_output = output(Command::new("date").arg("+%B %Y"));
let month_year = date_output.trim();
let month_year = t!(time::strftime("%B %Y", &time::now()));
// don't use our `bootstrap::util::{copy, cp_r}`, because those try
// to hardlink, and we don't want to edit the source templates
for entry_result in t!(fs::read_dir(man_src)) {
Expand All @@ -456,7 +456,7 @@ impl Step for Rustc {
t!(fs::copy(&page_src, &page_dst));
// template in month/year and version number
replace_in_file(&page_dst,
&[("<INSERT DATE HERE>", month_year),
&[("<INSERT DATE HERE>", &month_year),
("<INSERT VERSION HERE>", channel::CFG_RELEASE_NUM)]);
}

Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ extern crate cc;
extern crate getopts;
extern crate num_cpus;
extern crate toml;
extern crate time;

#[cfg(unix)]
extern crate libc;
Expand Down

0 comments on commit 1461d12

Please sign in to comment.