From b10dc1af0661c68155c49f508fe7a26a2ea02083 Mon Sep 17 00:00:00 2001 From: Zack Corr Date: Wed, 23 Jan 2013 19:25:03 +1000 Subject: [PATCH] Move semver to std and finish rustpkg --- src/libcore/core.rc | 2 -- src/librustpkg/rustpkg.rc | 7 +++---- src/librustpkg/util.rs | 10 +++++----- src/libstd/semver.rs | 2 +- src/libstd/std.rc | 1 + 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/libcore/core.rc b/src/libcore/core.rc index 6169ac24c05..da13145b9f6 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -169,8 +169,6 @@ pub mod reflect; pub mod condition; pub mod logging; pub mod util; -pub mod semver; - /* Reexported core operators */ diff --git a/src/librustpkg/rustpkg.rc b/src/librustpkg/rustpkg.rc index 329c61f1918..bb858f9070d 100644 --- a/src/librustpkg/rustpkg.rc +++ b/src/librustpkg/rustpkg.rc @@ -33,7 +33,7 @@ use send_map::linear::LinearMap; use rustc::metadata::filesearch; use rustc::driver::{driver, session}; use syntax::{ast, attr, codemap, diagnostic, parse, visit}; -use semver::Version; +use std::semver; mod usage; mod util; @@ -43,7 +43,7 @@ use util::Package; struct PackageScript { id: ~str, name: ~str, - vers: Version, + vers: semver::Version, crates: ~[~str], deps: ~[(~str, Option<~str>)], input: driver::input, @@ -222,8 +222,7 @@ impl PackageScript { } // Build the bootstrap and run a command - // FIXME: Use workcache to only compile the script when changed - // FIXME: Use JIT once it works, it should be faster + // FIXME (#4432): Use workcache to only compile the script when changed fn run(cmd: ~str) -> int { let work_dir = self.work_dir(); let input = self.input; diff --git a/src/librustpkg/util.rs b/src/librustpkg/util.rs index f9ac1b59782..150098cb57d 100644 --- a/src/librustpkg/util.rs +++ b/src/librustpkg/util.rs @@ -15,14 +15,14 @@ use syntax::ast_util::*; use syntax::{ast, attr, codemap, diagnostic, fold, parse, visit}; use codemap::span; -use semver::Version; +use std::semver; use std::{json, term, sort, getopts}; use getopts::groups::getopts; use Listener; pub struct Package { id: ~str, - vers: Version, + vers: semver::Version, bins: ~[~str], libs: ~[~str], } @@ -488,7 +488,7 @@ pub fn ready_crate(sess: session::Session, @fold.fold_crate(*crate) } -pub fn parse_vers(vers: ~str) -> result::Result { +pub fn parse_vers(vers: ~str) -> result::Result { match semver::parse(vers) { Some(vers) => result::Ok(vers), None => result::Err(~"could not parse version: invalid") @@ -1023,7 +1023,7 @@ pub fn exe_suffix() -> ~str { ~".exe" } pub fn exe_suffix() -> ~str { ~"" } -// FIXME: Use workcache to only compile when needed +// FIXME (#4432): Use workcache to only compile when needed pub fn compile_crate(sysroot: Option, crate: &Path, dir: &Path, flags: ~[~str], cfgs: ~[~str], opt: bool, test: bool) -> bool { @@ -1040,7 +1040,7 @@ pub fn compile_str(sysroot: Option, code: ~str, dir: &Path, #[cfg(windows)] pub fn link_exe(_src: &Path, _dest: &Path) -> bool { - /* FIXME: Investigate how to do this on win32 + /* FIXME (#1768): Investigate how to do this on win32 Node wraps symlinks by having a .bat, but that won't work with minGW. */ diff --git a/src/libstd/semver.rs b/src/libstd/semver.rs index 8af30b794e2..9de336437d2 100644 --- a/src/libstd/semver.rs +++ b/src/libstd/semver.rs @@ -17,7 +17,7 @@ use str; use to_str::ToStr; use char; -use cmp; +use core::cmp; pub struct Version { major: uint, diff --git a/src/libstd/std.rc b/src/libstd/std.rc index 3c2baae6d57..b0756104fe5 100644 --- a/src/libstd/std.rc +++ b/src/libstd/std.rc @@ -99,6 +99,7 @@ pub mod rl; pub mod workcache; pub mod bigint; pub mod stats; +pub mod semver; #[cfg(unicode)] mod unicode; -- GitLab