-Subproject commit ae740b4ba884050eeae5b39048de0c31c6bdef30
+Subproject commit aeaa9b7a216b42c42988521e79981f523e7a63fe
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)
}));
use core::{
Dependency,
PackageId,
- Source,
Summary
};
use core::dependency::SerializedDependency;
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
// .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>)
}
}
})));
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 {
use std::collections::HashMap;
pub struct Graph<N> {
- nodes: HashMap<N, ~[N]>
+ nodes: HashMap<N, Vec<N>>
}
enum Mark {
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));
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));
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() {
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)
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> {