minor fix

This commit is contained in:
Ward from fusion-voyager-3 2024-08-31 06:01:43 +03:00
parent 84003cb89e
commit dafbd58dda
2 changed files with 3 additions and 30 deletions

View File

@ -359,20 +359,7 @@ fn create_kernel_badges(
let json: serde_json::Value = let json: serde_json::Value =
serde_json::from_str(&kernel_db).expect("Unable to parse"); serde_json::from_str(&kernel_db).expect("Unable to parse");
let kernel_version_deter = match json["latest_kernel_version_deter_pkg"].as_str() { let kernel_version = json["latest_kernel_version"].as_str().to_owned().unwrap().to_string()
Some(t) => t,
_ => "kernel",
};
let kernel_version = match Command::new(
"/usr/lib/pika/kernel-manager/scripts/generate_package_info.sh",
)
.args(["version", &kernel_version_deter])
.output()
{
Ok(t) => String::from_utf8(t.stdout).unwrap().trim().to_owned(),
_ => "0.0.0".to_owned(),
};
let version_css_style = if &running_kernel_info.version == &kernel_version { let version_css_style = if &running_kernel_info.version == &kernel_version {
"background-green-bg" "background-green-bg"
@ -418,20 +405,6 @@ fn create_kernel_badges(
)); ));
} }
fn save_branch_config(branch: &str) {
let config_path = get_my_home()
.unwrap()
.unwrap()
.join(".config/pika-kernel-manager");
match &config_path.exists() {
true => fs::write(config_path.join("branch"), branch).unwrap(),
_ => {
fs::create_dir(&config_path).unwrap();
fs::write(config_path.join("branch"), branch).unwrap();
}
}
}
fn create_current_sched_badge( fn create_current_sched_badge(
badge_box: &adw::Bin, badge_box: &adw::Bin,
running_kernel_info: &RunningKernelInfo, running_kernel_info: &RunningKernelInfo,

View File

@ -237,8 +237,8 @@ fn add_package_rows(
let kernel_main_package_clone0 = kernel_main_package.clone(); let kernel_main_package_clone0 = kernel_main_package.clone();
std::thread::spawn(move || loop { std::thread::spawn(move || loop {
let command_installed_status = Command::new("rpm") let command_installed_status = Command::new("dpkg")
.args(["-q", &kernel_main_package_clone0]) .args(["-s", &kernel_main_package_clone0])
.output() .output()
.unwrap(); .unwrap();
if command_installed_status.status.success() { if command_installed_status.status.success() {