Fix system updates for Nobara (#661)
* Fix system updates for Nobara * fmt * Add os-release test for Nobara * Make requested changes * cargo fmt
This commit is contained in:
@@ -39,6 +39,7 @@ pub enum Distribution {
|
|||||||
Exherbo,
|
Exherbo,
|
||||||
NixOS,
|
NixOS,
|
||||||
KDENeon,
|
KDENeon,
|
||||||
|
Nobara,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Distribution {
|
impl Distribution {
|
||||||
@@ -53,7 +54,7 @@ impl Distribution {
|
|||||||
Some("alpine") => Distribution::Alpine,
|
Some("alpine") => Distribution::Alpine,
|
||||||
Some("centos") | Some("rhel") | Some("ol") => Distribution::CentOS,
|
Some("centos") | Some("rhel") | Some("ol") => Distribution::CentOS,
|
||||||
Some("clear-linux-os") => Distribution::ClearLinux,
|
Some("clear-linux-os") => Distribution::ClearLinux,
|
||||||
Some("fedora") | Some("nobara") => {
|
Some("fedora") => {
|
||||||
return if let Some(variant) = variant {
|
return if let Some(variant) = variant {
|
||||||
if variant.contains(&"Silverblue")
|
if variant.contains(&"Silverblue")
|
||||||
|| variant.contains(&"Kinoite")
|
|| variant.contains(&"Kinoite")
|
||||||
@@ -69,6 +70,7 @@ impl Distribution {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some("nobara") => Distribution::Nobara,
|
||||||
Some("void") => Distribution::Void,
|
Some("void") => Distribution::Void,
|
||||||
Some("debian") | Some("pureos") | Some("Deepin") => Distribution::Debian,
|
Some("debian") | Some("pureos") | Some("Deepin") => Distribution::Debian,
|
||||||
Some("arch") | Some("manjaro-arm") | Some("garuda") | Some("artix") => Distribution::Arch,
|
Some("arch") | Some("manjaro-arm") | Some("garuda") | Some("artix") => Distribution::Arch,
|
||||||
@@ -152,6 +154,7 @@ impl Distribution {
|
|||||||
Distribution::Bedrock => update_bedrock(ctx),
|
Distribution::Bedrock => update_bedrock(ctx),
|
||||||
Distribution::OpenMandriva => upgrade_openmandriva(ctx),
|
Distribution::OpenMandriva => upgrade_openmandriva(ctx),
|
||||||
Distribution::PCLinuxOS => upgrade_pclinuxos(ctx),
|
Distribution::PCLinuxOS => upgrade_pclinuxos(ctx),
|
||||||
|
Distribution::Nobara => upgrade_nobara(ctx),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,6 +232,40 @@ fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upgrade_nobara(ctx: &ExecutionContext) -> Result<()> {
|
||||||
|
let sudo = require_option(ctx.sudo().as_ref(), REQUIRE_SUDO.to_string())?;
|
||||||
|
let pkg_manager = require("dnf")?;
|
||||||
|
|
||||||
|
let mut update_command = ctx.run_type().execute(sudo);
|
||||||
|
update_command.arg(&pkg_manager);
|
||||||
|
|
||||||
|
if ctx.config().yes(Step::System) {
|
||||||
|
update_command.arg("-y");
|
||||||
|
}
|
||||||
|
|
||||||
|
update_command.arg("update");
|
||||||
|
// See https://nobaraproject.org/docs/upgrade-troubleshooting/how-do-i-update-the-system/
|
||||||
|
update_command.args([
|
||||||
|
"rpmfusion-nonfree-release",
|
||||||
|
"rpmfusion-free-release",
|
||||||
|
"fedora-repos",
|
||||||
|
"nobara-repos",
|
||||||
|
]);
|
||||||
|
update_command.arg("--refresh").status_checked()?;
|
||||||
|
|
||||||
|
let mut upgrade_command = ctx.run_type().execute(sudo);
|
||||||
|
upgrade_command.arg(&pkg_manager);
|
||||||
|
|
||||||
|
if ctx.config().yes(Step::System) {
|
||||||
|
upgrade_command.arg("-y");
|
||||||
|
}
|
||||||
|
|
||||||
|
upgrade_command.arg("distro-sync");
|
||||||
|
|
||||||
|
upgrade_command.status_checked()?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn upgrade_fedora_immutable(ctx: &ExecutionContext) -> Result<()> {
|
fn upgrade_fedora_immutable(ctx: &ExecutionContext) -> Result<()> {
|
||||||
let ostree = require("rpm-ostree")?;
|
let ostree = require("rpm-ostree")?;
|
||||||
let mut command = ctx.run_type().execute(ostree);
|
let mut command = ctx.run_type().execute(ostree);
|
||||||
@@ -1115,4 +1152,9 @@ mod tests {
|
|||||||
fn test_solus() {
|
fn test_solus() {
|
||||||
test_template(include_str!("os_release/solus"), Distribution::Solus);
|
test_template(include_str!("os_release/solus"), Distribution::Solus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_nobara() {
|
||||||
|
test_template(include_str!("os_release/nobara"), Distribution::Nobara);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/steps/os/os_release/nobara
Normal file
23
src/steps/os/os_release/nobara
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
NAME="Nobara Linux"
|
||||||
|
VERSION="39 (GNOME Edition)"
|
||||||
|
ID=nobara
|
||||||
|
ID_LIKE="rhel centos fedora"
|
||||||
|
VERSION_ID=39
|
||||||
|
VERSION_CODENAME=""
|
||||||
|
PLATFORM_ID="platform:f39"
|
||||||
|
PRETTY_NAME="Nobara Linux 39 (GNOME Edition)"
|
||||||
|
ANSI_COLOR="0;38;2;60;110;180"
|
||||||
|
LOGO=nobara-logo-icon
|
||||||
|
CPE_NAME="cpe:/o:nobaraproject:nobara:39"
|
||||||
|
DEFAULT_HOSTNAME="nobara"
|
||||||
|
HOME_URL="https://nobaraproject.org/"
|
||||||
|
DOCUMENTATION_URL="https://www.nobaraproject.org/"
|
||||||
|
SUPPORT_URL="https://www.nobaraproject.org/"
|
||||||
|
BUG_REPORT_URL="https://gitlab.com/gloriouseggroll/nobara-images"
|
||||||
|
REDHAT_BUGZILLA_PRODUCT="Nobara"
|
||||||
|
REDHAT_BUGZILLA_PRODUCT_VERSION=39
|
||||||
|
REDHAT_SUPPORT_PRODUCT="Nobara"
|
||||||
|
REDHAT_SUPPORT_PRODUCT_VERSION=39
|
||||||
|
SUPPORT_END=2024-05-14
|
||||||
|
VARIANT="GNOME Edition"
|
||||||
|
VARIANT_ID=gnome
|
||||||
Reference in New Issue
Block a user