Fix progress API to have "output message" separate from task

A lot of our output is outside of a "task"; the Rust binding
incorrectly made it a method on `Progress`.  This is really
just a `println!()` that is backed by our dispatch system.
This commit is contained in:
Colin Walters 2021-02-14 14:33:59 +00:00 committed by OpenShift Merge Robot
parent 1d242ddb59
commit 04e0c4e01a
3 changed files with 2 additions and 11 deletions

View File

@ -280,6 +280,8 @@ pub mod ffi {
fn progress_begin_task(msg: &str) -> UniquePtr<Progress>;
fn end(self: Pin<&mut Progress>, msg: &str);
fn output_message(msg: &str);
}
// rpmostree-rpm-util.h

View File

@ -124,16 +124,6 @@ progress_begin_task(const rust::Str msg) noexcept
return std::make_unique<Progress>(ProgressType::TASK);
}
// Output a string. Note that this should not be called when
// a "task" is active.
void
Progress::message(const rust::Str msg)
{
auto msg_c = std::string(msg);
RpmOstreeOutputMessage task = { msg_c.c_str() };
active_cb (RPMOSTREE_OUTPUT_MESSAGE, &task, active_cb_opaque);
}
// When working on a task/percent/nitems, often we want to display a particular
// item (such as a package).
void

View File

@ -36,7 +36,6 @@ void output_message (rust::Str msg);
struct Progress {
public:
void set_sub_message(rust::Str msg);
void message (rust::Str msg);
void nitems_update(guint n);
void percent_update(guint n);