Skip to content

Commit

Permalink
[r-darwish#956] add pkgfile support
Browse files Browse the repository at this point in the history
  • Loading branch information
cleonyc committed Jul 26, 2022
1 parent a5e0128 commit 635d062
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@ labels: is:bug
## What actually happened?


## Additional Details
## Additional details
- Which operating system or Linux distribution are you using?
- How did you install Topgrade?
- Which version are you running? <!-- Check with `topgrade -V` -->

<!--
Run `topgrade --dry-run` to see which commands Topgrade is running.
If the command seems wrong and you know why please tell us so.
If the command seems fine try to run it yourself and tell us if you got a different result from Topgrade.
If the command seems wrong and you know why pleaes tell us so.
If the command seems fine try to run it yourself
and tell us if you got a different result from Topgrade.
-->

<details>
<!-- Paste the output of the problematic command with `-v` into the pre-tags -->
<pre>

</pre>
</details>
<details><pre>
Paste the output of `topgrade -v`
</pre></details>
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::Pacstall, "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

0 comments on commit 635d062

Please sign in to comment.