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

[#956] Add pkgfile support #980

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ pub enum Step {
Node,
Opam,
Pacstall,
Pkgfile,
Pearl,
Pipx,
Pip3,
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ fn run() -> Result<()> {
runner.execute(Step::Flatpak, "Flatpak", || linux::flatpak_update(&ctx))?;
runner.execute(Step::Snap, "snap", || linux::run_snap(sudo.as_ref(), run_type))?;
runner.execute(Step::Pacstall, "pacstall", || linux::run_pacstall(&ctx))?;
runner.execute(Step::Pkgfile, "pkgfile", || linux::run_pkgfile(sudo.as_ref(), &ctx))?;
}

if let Some(commands) = config.commands() {
Expand Down
7 changes: 7 additions & 0 deletions src/steps/os/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,13 @@ pub fn flatpak_update(ctx: &ExecutionContext) -> Result<()> {

Ok(())
}
pub fn run_pkgfile(sudo: Option<&PathBuf>, ctx: &ExecutionContext) -> Result<()> {
let sudo = require_option(sudo, String::from("sudo is not installed"))?;
let pkgfile = require("pkgfile")?;
print_separator("pkgfile");

ctx.run_type().execute(sudo).arg(pkgfile).arg("--update").check_run()
}

pub fn run_snap(sudo: Option<&PathBuf>, run_type: RunType) -> Result<()> {
let sudo = require_option(sudo, String::from("sudo is not installed"))?;
Expand Down