From fb17ec806456d84e867b2c68a353da04a65efe42 Mon Sep 17 00:00:00 2001 From: Atterpac <89053530+Atterpac@users.noreply.github.com> Date: Sat, 21 Oct 2023 01:32:50 -0400 Subject: [PATCH] Allow Wails3 Doctor recognize globally installed apt packages (#2972) * Fixes doctor bug for apt package manager * Actually fix it * Pad the text " all" Adding a space to ensure checking against "all" doesn't always catch "install" or "not-installed" etc * Update changelog.md Doctor Apt Verify --------- Co-authored-by: atterpac Co-authored-by: Lea Anthony --- mkdocs-website/docs/changelog.md | 4 +++- v3/internal/doctor/packagemanager/apt.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mkdocs-website/docs/changelog.md b/mkdocs-website/docs/changelog.md index 0b3982fc0..3cd72065d 100644 --- a/mkdocs-website/docs/changelog.md +++ b/mkdocs-website/docs/changelog.md @@ -23,10 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- [darwin] Fixed application frozen when quit by @5aaee9 in [#2982](https://github.com/wailsapp/wails/pull/2982) +- Fixed Doctor apt package verify by [Atterpac](https://github.com/Atterpac) in [#2972](https://github.com/wailsapp/wails/pull/2972). +- Fixed application frozen when quit (Darwin) by @5aaee9 in [#2982](https://github.com/wailsapp/wails/pull/2982) - Fixed background colours of examples on Windows by [mmgvh](https://github.com/mmghv) in [#2750](https://github.com/wailsapp/wails/pull/2750). - Fixed default context menus by [mmgvh](https://github.com/mmghv) in [#2753](https://github.com/wailsapp/wails/pull/2753). + ### Changed ### Removed diff --git a/v3/internal/doctor/packagemanager/apt.go b/v3/internal/doctor/packagemanager/apt.go index 89e95ae36..31926bda2 100644 --- a/v3/internal/doctor/packagemanager/apt.go +++ b/v3/internal/doctor/packagemanager/apt.go @@ -58,7 +58,8 @@ func (a *Apt) PackageInstalled(pkg *Package) (bool, error) { return false, nil } output, err := a.listPackage(pkg.Name) - return strings.Contains(output, "[installed]"), err + // apt list -qq returns "all" if you have packages installed globally and locally + return strings.Contains(output, "installed") || strings.Contains(output, " all"), err } // PackageAvailable tests if the given package is available for installation