Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Support deb-get #925

Merged
merged 4 commits into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Support deb-get
Fixes #923
  • Loading branch information
r-darwish committed May 7, 2022
commit 5cc3294cce5570ec99ebf54fa86afdab79b26f6d
14 changes: 14 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cargo",
"command": "clippy",
"problemMatcher": [
"$rustc"
],
"group": "test",
"label": "rust: cargo clippy"
}
]
}
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub enum Step {
ConfigUpdate,
Containers,
CustomCommands,
DebGet,
Deno,
Dotnet,
Emacs,
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,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))?;
Expand Down
13 changes: 13 additions & 0 deletions src/steps/os/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,19 @@ fn upgrade_debian(ctx: &ExecutionContext) -> Result<()> {
Ok(())
}

pub fn run_deb_get(ctx: &ExecutionContext) -> Result<()> {
let deb_get = require("deb-get")?;

ctx.execute_elevated(&deb_get, false)?.arg("update").check_run()?;
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()?;
Expand Down