Support deb-get (#925)

This commit is contained in:
Roey Darwish Dror 2022-05-07 09:14:20 +03:00 committed by GitHub
parent 8e7fd6772d
commit fdf03f6548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

14
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cargo",
"command": "clippy",
"problemMatcher": [
"$rustc"
],
"group": "test",
"label": "rust: cargo clippy"
}
]
}

View File

@ -81,6 +81,7 @@ pub enum Step {
ConfigUpdate,
Containers,
CustomCommands,
DebGet,
Deno,
Dotnet,
Emacs,

View File

@ -351,6 +351,7 @@ fn run() -> Result<()> {
#[cfg(target_os = "linux")]
{
runner.execute(Step::DebGet, "deb-get", || linux::run_deb_get(&ctx))?;
runner.execute(Step::Toolbx, "toolbx", || toolbx::run_toolbx(&ctx))?;
runner.execute(Step::Flatpak, "Flatpak", || linux::flatpak_update(&ctx))?;
runner.execute(Step::Snap, "snap", || linux::run_snap(sudo.as_ref(), run_type))?;

View File

@ -313,6 +313,20 @@ fn upgrade_debian(ctx: &ExecutionContext) -> Result<()> {
Ok(())
}
pub fn run_deb_get(ctx: &ExecutionContext) -> Result<()> {
let deb_get = require("deb-get")?;
print_separator("deb-get");
ctx.execute_elevated(&deb_get, false)?.arg("upgrade").check_run()?;
if ctx.config().cleanup() {
ctx.execute_elevated(&deb_get, false)?.arg("clean").check_run()?;
}
Ok(())
}
fn upgrade_solus(ctx: &ExecutionContext) -> Result<()> {
if let Some(sudo) = ctx.sudo() {
ctx.run_type().execute(&sudo).args(&["eopkg", "upgrade"]).check_run()?;