-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
Mostly just tests (that are ignored); install command is still stubbed out.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// Context data structure used by rustpkg | ||
|
||
use core::hashmap::HashMap; | ||
|
||
pub struct Ctx { | ||
// I'm not sure what this is for | ||
json: bool, | ||
// Cache of hashes of things already installed | ||
// though I'm not sure why the value is a bool | ||
dep_cache: @mut HashMap<~str, bool>, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// rustpkg utilities having to do with workspaces | ||
|
||
use path_util::{rust_path, workspace_contains_package_id}; | ||
use util::PkgId; | ||
use core::path::Path; | ||
|
||
pub fn pkg_parent_workspaces(pkgid: PkgId, action: &fn(&Path) -> bool) { | ||
// Using the RUST_PATH, find workspaces that contain | ||
// this package ID | ||
let workspaces = rust_path().filtered(|ws| | ||
workspace_contains_package_id(pkgid, ws)); | ||
if workspaces.is_empty() { | ||
// tjc: make this a condition | ||
fail!(fmt!("Package %s not found in any of \ | ||
the following workspaces: %s", | ||
pkgid.path.to_str(), | ||
rust_path().to_str())); | ||
} | ||
for workspaces.each |ws| { | ||
if action(ws) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
catamorphism
Author
Contributor
|
||
break; | ||
} | ||
} | ||
} |
5 comments
on commit 4e2c8f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from graydon
at catamorphism@4e2c8f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging catamorphism/rust/rustpkg = 4e2c8f4 into auto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding incoming to auto = 0604468
I was taking a look at changing the for loop protocols, and I ran across this. Is this supposed to be
!action
, or is this supposed to yield just one workspace (both use cases currently look like they only use the first workspace returned and then this breaks out)