Skip to content

Commit 1461d12

Browse files
committed
Use time crate in bootstrap dist instead of date
1 parent 07ea260 commit 1461d12

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

src/Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ serde_derive = "1.0.8"
4141
serde_json = "1.0.2"
4242
toml = "0.4"
4343
lazy_static = "0.2"
44+
time = "0.1"

src/bootstrap/dist.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use builder::{Builder, RunConfig, ShouldRun, Step};
3333
use compile;
3434
use tool::{self, Tool};
3535
use cache::{INTERNER, Interned};
36+
use time;
3637

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

src/bootstrap/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ extern crate cc;
130130
extern crate getopts;
131131
extern crate num_cpus;
132132
extern crate toml;
133+
extern crate time;
133134

134135
#[cfg(unix)]
135136
extern crate libc;

0 commit comments

Comments
 (0)