rom: cleanup; defer to cognos for state management

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69647ec63e70606bc2e8e03ba97546f70c09
This commit is contained in:
raf 2025-10-10 10:00:42 +03:00
commit e0069c0ec3
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
10 changed files with 114 additions and 56 deletions

View file

@ -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);
}