diff --git a/src/docbuilder/chroot_builder.rs b/src/docbuilder/chroot_builder.rs
index b561bc199..f643722f8 100644
--- a/src/docbuilder/chroot_builder.rs
+++ b/src/docbuilder/chroot_builder.rs
@@ -11,7 +11,7 @@ use std::process::Command;
use std::path::PathBuf;
use std::fs::remove_dir_all;
use postgres::Connection;
-use rustc_serialize::json::Json;
+use rustc_serialize::json::{Json, ToJson};
use error::Result;
@@ -314,7 +314,7 @@ impl DocBuilder {
/// Gets rustc and cratesfyi version from chroot environment
- fn get_versions(&self) -> (String, String) {
+ pub fn get_versions(&self) -> (String, String) {
// It is safe to use expect here
// chroot environment must always have rustc and cratesfyi installed
(String::from(self.chroot_command("rustc --version")
@@ -439,6 +439,15 @@ impl DocBuilder {
try!(self.clean(&pkg));
+ let (vers, _) = self.get_versions();
+
+ try!(conn.query("INSERT INTO config (name, value) VALUES ('rustc_version', $1)",
+ &[&vers.to_json()])
+ .or_else(|_| {
+ conn.query("UPDATE config SET value = $1 WHERE name = 'rustc_version'",
+ &[&vers.to_json()])
+ }));
+
Ok(())
}
}
diff --git a/src/web/mod.rs b/src/web/mod.rs
index 068f73c9f..a008013f7 100644
--- a/src/web/mod.rs
+++ b/src/web/mod.rs
@@ -61,7 +61,6 @@ use semver::{Version, VersionReq};
use rustc_serialize::json::{Json, ToJson};
use std::collections::BTreeMap;
-
/// Duration of static files for staticfile and DatabaseFileHandler (in seconds)
const STATIC_FILE_CACHE_DURATION: u64 = 60 * 60 * 24 * 30 * 12; // 12 months
const STYLE_CSS: &'static str = include_str!(concat!(env!("OUT_DIR"), "/style.css"));
@@ -97,9 +96,7 @@ impl CratesfyiHandler {
let mut router = Router::new();
router.get("/", releases::home_page, "index");
router.get("/style.css", style_css_handler, "style_css");
- router.get("/about",
- |_: &mut Request| page::Page::new(false).title("About Docs.rs").to_resp("about"),
- "about");
+ router.get("/about", sitemap::about_handler, "about");
router.get("/robots.txt", sitemap::robots_txt_handler, "robots_txt");
router.get("/sitemap.xml", sitemap::sitemap_handler, "sitemap_xml");
router.get("/opensearch.xml", opensearch_xml_handler, "opensearch_xml");
@@ -427,7 +424,6 @@ fn opensearch_xml_handler(_: &mut Request) -> IronResult{{content.rustc_version}}
.
+ If you need a newer version of this compiler, check the
+ issues page
+ and file a new issue if you don't see an existing request.
+ {{/if}}