Skip to content

Commit

Permalink
fix: only follow crates.io dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
AerialX committed Oct 29, 2015
1 parent 7d2bf5b commit 90fb9fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/deps/raw_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::str::FromStr;
pub struct RawDep {
pub name: String,
pub ver: String,
pub source: String,
pub children: Option<Vec<String>>,
pub parent: Option<String>
}
Expand All @@ -18,6 +19,7 @@ impl FromStr for RawDep {
Ok(RawDep {
name: raw_dep_vec[0].to_owned(),
ver: raw_dep_vec[1].to_owned(),
source: raw_dep_vec.get(2).map(|v| (*v).to_owned()).unwrap_or(String::new()),
children: None,
parent: None
})
Expand Down
7 changes: 6 additions & 1 deletion src/lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ impl Lockfile {
Ok(val) => val,
Err(e) => return Err(CliError::Generic(e))
};
if !child.source.starts_with("(registry+") {
continue
}
child.parent = Some(name.to_owned());
children.push(child.name.clone());
if all_deps || depth > 1 {
Expand Down Expand Up @@ -369,7 +372,9 @@ impl Lockfile {
Ok(val) => val,
Err(e) => return Err(CliError::Generic(e))
};
self.deps.insert(raw_dep.name.clone(), raw_dep);
if raw_dep.source.starts_with("(registry+") {
self.deps.insert(raw_dep.name.clone(), raw_dep);
}
}
},
Some(_) => unreachable!(),
Expand Down

0 comments on commit 90fb9fa

Please sign in to comment.