Add ID reporting in imag-store
This commit is contained in:
parent
c616a5cfaf
commit
f20298cbe8
5 changed files with 24 additions and 12 deletions
|
@ -62,6 +62,8 @@ pub fn create(rt: &Runtime) {
|
|||
Entry::default_header())
|
||||
}
|
||||
.map_err_trace_exit_unwrap(1);
|
||||
|
||||
let _ = rt.report_touched(&path).map_err_trace_exit_unwrap(1);
|
||||
}
|
||||
|
||||
fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> Result<()> {
|
||||
|
|
|
@ -34,8 +34,11 @@ pub fn get(rt: &Runtime) {
|
|||
let path = StoreId::new(store, path).map_err_trace_exit_unwrap(1);
|
||||
debug!("path = {:?}", path);
|
||||
|
||||
let _ = match rt.store().get(path).map_err_trace_exit_unwrap(1) {
|
||||
Some(entry) => print_entry(rt, scmd, entry),
|
||||
let _ = match rt.store().get(path.clone()).map_err_trace_exit_unwrap(1) {
|
||||
Some(entry) => {
|
||||
print_entry(rt, scmd, entry);
|
||||
let _ = rt.report_touched(&path).map_err_trace_exit_unwrap(1);
|
||||
},
|
||||
None => info!("No entry found"),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -42,11 +42,13 @@ pub fn retrieve(rt: &Runtime) {
|
|||
debug!("path = {:?}", path);
|
||||
|
||||
rt.store()
|
||||
.retrieve(path)
|
||||
.retrieve(path.clone())
|
||||
.map(|e| print_entry(rt, scmd, e))
|
||||
.map_dbg_str("No entry")
|
||||
.map_dbg(|e| format!("{:?}", e))
|
||||
.map_err_trace()
|
||||
.map_err_trace_exit_unwrap(1);
|
||||
|
||||
let _ = rt.report_touched(&path).map_err_trace_exit_unwrap(1);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -36,16 +36,20 @@ pub fn update(rt: &Runtime) {
|
|||
let _ = rt.store()
|
||||
.retrieve(path)
|
||||
.map(|mut locked_e| {
|
||||
let e = locked_e.deref_mut();
|
||||
{
|
||||
let e = locked_e.deref_mut();
|
||||
|
||||
scmd.value_of("content")
|
||||
.map(|new_content| {
|
||||
*e.get_content_mut() = String::from(new_content);
|
||||
debug!("New content set");
|
||||
});
|
||||
scmd.value_of("content")
|
||||
.map(|new_content| {
|
||||
*e.get_content_mut() = String::from(new_content);
|
||||
debug!("New content set");
|
||||
});
|
||||
|
||||
*e.get_header_mut() = build_toml_header(scmd, e.get_header().clone());
|
||||
debug!("New header set");
|
||||
*e.get_header_mut() = build_toml_header(scmd, e.get_header().clone());
|
||||
debug!("New header set");
|
||||
}
|
||||
|
||||
let _ = rt.report_touched(locked_e.get_location()).map_err_trace_exit_unwrap(1);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ pub fn verify(rt: &Runtime) {
|
|||
};
|
||||
|
||||
info!("{: >6} | {: >14} | {:?}", verify, content_len, p.deref());
|
||||
let _ = rt.report_touched(fle.get_location()).map_err_trace_exit_unwrap(1);
|
||||
status
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue