Skip to content

Commit

Permalink
Auto merge of #2704 - alexcrichton:clean-no-fetch, r=brson
Browse files Browse the repository at this point in the history
Don't fetch all crates on clean

Only fetch those that are needed by avoiding `ops::fetch`
  • Loading branch information
bors committed Jun 11, 2016
2 parents 13861b7 + 9a19cda commit 880fde5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cargo/ops/cargo_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::fs;
use std::path::Path;

use core::{Package, Profiles};
use core::registry::PackageRegistry;
use util::{CargoResult, human, ChainError, Config};
use ops::{self, Layout, Context, BuildConfig, Kind, Unit};

Expand All @@ -28,7 +29,9 @@ pub fn clean(manifest_path: &Path, opts: &CleanOptions) -> CargoResult<()> {
return rm_rf(&target_dir);
}

let (resolve, packages) = try!(ops::fetch(manifest_path, opts.config));
let mut registry = PackageRegistry::new(opts.config);
let resolve = try!(ops::resolve_pkg(&mut registry, &root, opts.config));
let packages = ops::get_resolved_packages(&resolve, registry);

let dest = if opts.release {"release"} else {"debug"};
let host_layout = try!(Layout::new(opts.config, &root, None, dest));
Expand Down

0 comments on commit 880fde5

Please sign in to comment.