rom: cleanup; defer to cognos for state management
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a69647ec63e70606bc2e8e03ba97546f70c09
This commit is contained in:
parent
5fea07c768
commit
e0069c0ec3
10 changed files with 114 additions and 56 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
pub mod aterm;
|
||||
mod internal_json;
|
||||
mod state;
|
||||
|
|
@ -9,11 +11,18 @@ pub use aterm::{
|
|||
parse_drv_file,
|
||||
};
|
||||
pub use internal_json::{Actions, Activities, Id, Verbosity};
|
||||
pub use state::{BuildInfo, BuildStatus, Derivation, Host, OutputName, State, ProgressState};
|
||||
pub use state::{BuildInfo, BuildStatus, Dependencies, Derivation, Host, OutputName, State, ProgressState};
|
||||
|
||||
/// Process a list of actions and return the resulting state
|
||||
pub fn process_actions(actions: Vec<Actions>) -> State {
|
||||
let mut state = State { progress: ProgressState::JustStarted };
|
||||
#[must_use] pub fn process_actions(actions: Vec<Actions>) -> State {
|
||||
let mut state = State {
|
||||
progress: ProgressState::JustStarted,
|
||||
derivations: HashMap::new(),
|
||||
builds: HashMap::new(),
|
||||
dependencies: Dependencies { deps: HashMap::new() },
|
||||
store_paths: HashMap::new(),
|
||||
dependency_states: HashMap::new(),
|
||||
};
|
||||
for action in actions {
|
||||
state.imbibe(action);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue