mirror of https://github.com/rust-lang/cargo
Update to master and fix warnings
This commit is contained in:
parent
d6f9072728
commit
9c101e39a4
|
@ -1 +1 @@
|
|||
Subproject commit ae740b4ba884050eeae5b39048de0c31c6bdef30
|
||||
Subproject commit aeaa9b7a216b42c42988521e79981f523e7a63fe
|
|
@ -33,7 +33,7 @@ fn execute(options: Options) -> CLIResult<Option<()>> {
|
|||
CLIError::new(format!("The URL `{}` you passed was not a valid URL", url), None::<&str>, 1)));
|
||||
|
||||
let remote = GitRemote::new(url, verbose);
|
||||
let source = GitSource::new(remote, reference, Path::new(database_path), Path::new(checkout_path), verbose);
|
||||
let source = GitSource::new(remote, reference, Path::new(database_path), Path::new(checkout_path));
|
||||
try!(source.update().map_err(|e| {
|
||||
CLIError::new(format!("Couldn't update {}: {}", source, e), None::<&str>, 1)
|
||||
}));
|
||||
|
|
|
@ -6,7 +6,6 @@ use core::source::SourceId;
|
|||
use core::{
|
||||
Dependency,
|
||||
PackageId,
|
||||
Source,
|
||||
Summary
|
||||
};
|
||||
use core::dependency::SerializedDependency;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use url::Url;
|
||||
use core::{Summary,Package,PackageId};
|
||||
use util::CargoResult;
|
||||
use sources::GitSource;
|
||||
|
||||
/**
|
||||
* A Source finds and downloads remote packages based on names and
|
||||
|
|
|
@ -64,7 +64,7 @@ fn sources_for(package: &Package) -> CargoResult<SourceSet> {
|
|||
// .cargo/git/checkouts
|
||||
let db_path = git.join("db").join(source_id.url.to_str());
|
||||
let checkout_path = git.join("checkouts").join(source_id.url.to_str()).join(reference.as_slice());
|
||||
Ok(box GitSource::new(remote, reference.clone(), db_path, checkout_path, false) as Box<Source>)
|
||||
Ok(box GitSource::new(remote, reference.clone(), db_path, checkout_path) as Box<Source>)
|
||||
}
|
||||
}
|
||||
})));
|
||||
|
|
|
@ -11,13 +11,12 @@ pub struct GitSource {
|
|||
remote: GitRemote,
|
||||
reference: GitReference,
|
||||
db_path: Path,
|
||||
checkout_path: Path,
|
||||
verbose: bool
|
||||
checkout_path: Path
|
||||
}
|
||||
|
||||
impl GitSource {
|
||||
pub fn new(remote: GitRemote, reference: String, db: Path, checkout: Path, verbose: bool) -> GitSource {
|
||||
GitSource { remote: remote, reference: GitReference::for_str(reference), db_path: db, checkout_path: checkout, verbose: verbose }
|
||||
pub fn new(remote: GitRemote, reference: String, db: Path, checkout: Path) -> GitSource {
|
||||
GitSource { remote: remote, reference: GitReference::for_str(reference), db_path: db, checkout_path: checkout }
|
||||
}
|
||||
|
||||
pub fn get_namespace<'a>(&'a self) -> &'a url::Url {
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::hash::Hash;
|
|||
use std::collections::HashMap;
|
||||
|
||||
pub struct Graph<N> {
|
||||
nodes: HashMap<N, ~[N]>
|
||||
nodes: HashMap<N, Vec<N>>
|
||||
}
|
||||
|
||||
enum Mark {
|
||||
|
|
|
@ -68,7 +68,7 @@ impl ProcessBuilder {
|
|||
pub fn exec(&self) -> CargoResult<()> {
|
||||
let mut command = self.build_command();
|
||||
command
|
||||
.env(self.build_env())
|
||||
.env(self.build_env().as_slice())
|
||||
.stdout(InheritFd(1))
|
||||
.stderr(InheritFd(2));
|
||||
|
||||
|
@ -84,7 +84,7 @@ impl ProcessBuilder {
|
|||
|
||||
pub fn exec_with_output(&self) -> CargoResult<ProcessOutput> {
|
||||
let mut command = self.build_command();
|
||||
command.env(self.build_env());
|
||||
command.env(self.build_env().as_slice());
|
||||
|
||||
let output = try!(command.output().map_err(io_error));
|
||||
|
||||
|
@ -106,7 +106,7 @@ impl ProcessBuilder {
|
|||
format!("{} {}", self.program, self.args.connect(" "))
|
||||
}
|
||||
|
||||
fn build_env(&self) -> ~[(String, String)] {
|
||||
fn build_env(&self) -> Vec<(String, String)> {
|
||||
let mut ret = Vec::new();
|
||||
|
||||
for (key, val) in self.env.iter() {
|
||||
|
|
|
@ -80,8 +80,8 @@ pub struct CargoError {
|
|||
impl Show for CargoError {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
match self.desc {
|
||||
StaticDescription(string) => write!(f, "{}", string),
|
||||
BoxedDescription(ref string) => write!(f, "{}", string)
|
||||
StaticDescription(string) => try!(write!(f, "{}", string)),
|
||||
BoxedDescription(ref string) => try!(write!(f, "{}", string))
|
||||
};
|
||||
|
||||
write!(f, "; kind={}", self.kind)
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::collections::HashMap;
|
|||
use serialize::Decodable;
|
||||
|
||||
use core::source::{SourceId,GitKind};
|
||||
use core::{Summary,Manifest,Target,Dependency,PackageId,Source};
|
||||
use core::{Summary,Manifest,Target,Dependency,PackageId};
|
||||
use util::{CargoResult,Require,simple_human,toml_error};
|
||||
|
||||
pub fn to_manifest(contents: &[u8], namespace: &Url) -> CargoResult<Manifest> {
|
||||
|
|
Loading…
Reference in New Issue