prep for normal fedora kernels

This commit is contained in:
Ward from fusion-voyager-3 2024-06-24 03:23:06 +03:00
parent 462dbf693f
commit c86eca1729
5 changed files with 18 additions and 11 deletions

View File

@ -1,5 +1,5 @@
{
"latest_version": "6.9.5",
"latest_kernel_version_deter_pkg": "kernel-cachyos",
"kernels": [
{
"name": "CachyOS Default Kernel",

View File

@ -3,9 +3,9 @@
if [[ $1 == "version" ]]
then
#apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1
dnf info $2 | grep Version | cut -d":" -f2 | head -n1
dnf info $2 2> /dev/null | grep Version | cut -d":" -f2 | head -n1
elif [[ $1 == "description" ]]
then
#apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
dnf info $2 | sed -n '/Description/,/^$/p' | awk 'NR==1,/^$/ {if (/^$/ && printed) exit; if (NF) printed=1; if (NR==1) sub(/Description *: */, ""); else sub(/^ *: */, ""); print}'
dnf info $2 2> /dev/null | sed -n '/Description/,/^$/p' | awk 'NR==1,/^$/ {if (/^$/ && printed) exit; if (NF) printed=1; if (NR==1) sub(/Description *: */, ""); else sub(/^ *: */, ""); print}'
fi

View File

@ -30,7 +30,6 @@ Requires: glib2
Requires: util-linux
Requires: polkit
Requires: iputils
Requires: fedora-kernel-manager-cachyos-config
Recommends: sched-ext-scx

View File

@ -133,10 +133,7 @@ pub fn content(
browse_kernels_button.connect_clicked(
clone!(@weak window, @weak content_stack, @strong selected_kernel_branch => move |_| {
match content_stack.child_by_name("kernel_pkg_page") {
Some(_) => {},
None => kernel_pkg::kernel_pkg_page(&content_stack, &window, &selected_kernel_branch)
};
kernel_pkg::kernel_pkg_page(&content_stack, &window, &selected_kernel_branch);
content_stack.set_visible_child_name("kernel_pkg_page")
}),
);
@ -503,9 +500,19 @@ fn create_kernel_badges(
let json: serde_json::Value =
serde_json::from_str(&selected_kernel_branch_clone.db).expect("Unable to parse");
let kernel_version = match json["latest_version"].as_str() {
let kernel_version_deter = match json["latest_kernel_version_deter_pkg"].as_str() {
Some(t) => t,
_ => "Unknown",
_ => "kernel",
};
let kernel_version = match Command::new(
"/usr/lib/fedora-kernel-manager/scripts/generate_package_info.sh",
)
.args(["version", &kernel_version_deter])
.output()
{
Ok(t) => String::from_utf8(t.stdout).unwrap().trim(),
_ => "0.0.0".to_owned(),
};
let version_css_style = if &running_kernel_info.version == &kernel_version {

View File

@ -138,6 +138,7 @@ pub fn kernel_pkg_page(
back_button.connect_clicked(clone!(@weak content_stack, @weak main_box => move |_| {
content_stack.set_visible_child_name("content_page");
content_stack.remove(&main_box);
}));
window_bottombar.append(&back_button);
@ -191,7 +192,7 @@ fn add_package_rows(
let kernel_package_version = match Command::new(
"/usr/lib/fedora-kernel-manager/scripts/generate_package_info.sh",
)
.args(["description", &kernel_main_package])
.args(["version", &kernel_main_package])
.output()
{
Ok(t) => String::from_utf8(t.stdout).unwrap(),