From 635d0628a95e7f1e2ca06908218120c73cdc4aa6 Mon Sep 17 00:00:00 2001 From: Cleo Date: Tue, 26 Jul 2022 17:02:38 -0400 Subject: [PATCH 1/3] [#956] add pkgfile support --- .github/ISSUE_TEMPLATE/bug_report.md | 17 +++++++---------- src/main.rs | 1 + src/steps/os/linux.rs | 7 +++++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index da49501a..3829b181 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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? -
- -
-
-
-
+
+Paste the output of `topgrade -v`
+
diff --git a/src/main.rs b/src/main.rs index 88d0f605..f787c644 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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() { diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index 16171038..ba022d69 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -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"))?; From 8b3aabe6d9bf00da4d657ba4cd79fa4ff342ed56 Mon Sep 17 00:00:00 2001 From: Cleo Date: Tue, 26 Jul 2022 17:12:42 -0400 Subject: [PATCH 2/3] fix weirdness (issue template changed) --- .github/ISSUE_TEMPLATE/bug_report.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3829b181..da49501a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,17 +12,20 @@ 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? -
-Paste the output of `topgrade -v`
-
+
+ +
+
+
+
From 77daf630614c0df670bf26a3b331ac392bf0e98c Mon Sep 17 00:00:00 2001 From: Cleo Date: Tue, 26 Jul 2022 17:15:07 -0400 Subject: [PATCH 3/3] Add pkgfile step to enum --- src/config.rs | 1 + src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 9eec74c7..3ba3908f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -108,6 +108,7 @@ pub enum Step { Node, Opam, Pacstall, + Pkgfile, Pearl, Pipx, Pip3, diff --git a/src/main.rs b/src/main.rs index f787c644..2dd63d65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -361,7 +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))?; + runner.execute(Step::Pkgfile, "pkgfile", || linux::run_pkgfile(sudo.as_ref(), &ctx))?; } if let Some(commands) = config.commands() {