Packages (Linux): try detecting pkgtool

fix #486
This commit is contained in:
李通洲 2023-07-03 23:18:36 +08:00 committed by 李通洲
parent 1f5da2736e
commit 482b15c62e
No known key found for this signature in database
GPG Key ID: 269AD4F5325A22A3
7 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,11 @@
# 1.12.2
Features:
* Support `pkgtool` package manager detection (Linux, Packages)
# 1.12.1
Bugfixes:
* Fix compiling error on Apple Slicon (Bios, macOS)
# 1.12.0

View File

@ -102,7 +102,7 @@ AlmaLinux, Alpine, Android, Arch, Arco, Artix, Bedrock, CachyOS, CentOS, CRUX, C
##### Package managers
```
apk, brew, Chocolatey, dpkg, emerge, eopkg, Flatpak, MacPorts, nix, Pacman, pkg, rpm, scoop, Snap, xbps
apk, brew, Chocolatey, dpkg, emerge, eopkg, Flatpak, MacPorts, nix, Pacman, pkg, pkgtool, rpm, scoop, Snap, xbps
```
##### WM themes

View File

@ -3,7 +3,7 @@
--kernel-format Sysname: {}; Release: {}; Version: {}
--uptime-format Days: {}; Hours: {}; Minutes: {}; Seconds: {}
--processes-format Count: {}
--packages-format All: {}; pacman: {}; pacman branch: {}; dpkg: {}; rpm: {}; emerge: {}; eopkg: {}; xbps: {}; apk: {}; flatpak-system: {}; flatpak-user: {}; snap: {}; brew: {}; brew-cask: {}; port: {}; scoop: {}; choco: {}
--packages-format All: {}; pacman: {}; pacman branch: {}; dpkg: {}; rpm: {}; emerge: {}; eopkg: {}; xbps: {}; apk: {}; flatpak-system: {}; flatpak-user: {}; snap: {}; brew: {}; brew-cask: {}; port: {}; scoop: {}; choco: {}; pkgtool: {}
--shell-format Process name: {}; Process path: {}; Process exe: {}; Process version: {}; User path: {}; User exe: {}; User version: {}
--display-format Width: {}; Height: {}; Refresh rate: {}; ScaledWith: {}; ScaledHeight: {}
--de-format Process name: {}; Pretty name: {}; Version: {}

View File

@ -21,6 +21,7 @@ typedef struct FFPackagesResult
uint32_t nixUser;
uint32_t pacman;
uint32_t pkg;
uint32_t pkgtool;
uint32_t port;
uint32_t rpm;
uint32_t scoop;

View File

@ -276,6 +276,7 @@ static void getPackageCounts(const FFinstance* instance, FFstrbuf* baseDir, FFPa
packageCounts->nixSystem += getNixPackages(baseDir, "/run/current-system");
packageCounts->pacman += getNumElements(baseDir, "/var/lib/pacman/local", DT_DIR);
packageCounts->pkg += getSQLite3Int(instance, baseDir, "/var/db/pkg/local.sqlite", "SELECT count(id) FROM packages");
packageCounts->pkgtool += getNumElements(baseDir, "/var/log/packages", DT_REG);
packageCounts->rpm += getSQLite3Int(instance, baseDir, "/var/lib/rpm/rpmdb.sqlite", "SELECT count(blob) FROM Packages");
packageCounts->snap += getSnap(baseDir);
packageCounts->xbps += getXBPS(baseDir, "/var/db/xbps");

View File

@ -139,7 +139,7 @@ static inline void printCommandHelp(const char* command)
}
else if(strcasecmp(command, "packages-format") == 0)
{
constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (eopkg), {8} (xbps), {9} (nix-system), {10} (nix-user), {11} (nix-default), {12} (apk), {13} (pkg), {14} (flatpak-system), {15} (flatpack-user), {16} (snap), {17} (brew), {18} (brew-cask), {19} (port), {20} (scoop), {21} (choco)", 21,
constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (eopkg), {8} (xbps), {9} (nix-system), {10} (nix-user), {11} (nix-default), {12} (apk), {13} (pkg), {14} (flatpak-system), {15} (flatpack-user), {16} (snap), {17} (brew), {18} (brew-cask), {19} (port), {20} (scoop), {21} (choco), {22} (pkgtool)", 22,
"Number of all packages",
"Number of pacman packages",
"Pacman branch on manjaro",
@ -160,7 +160,8 @@ static inline void printCommandHelp(const char* command)
"Number of brew-cask packages",
"Number of macports packages",
"Number of scoop packages",
"Number of choco packages"
"Number of choco packages",
"Number of pkgtool packages"
);
}
else if(strcasecmp(command, "shell-format") == 0)

View File

@ -57,6 +57,7 @@ void ffPrintPackages(FFinstance* instance)
FF_PRINT_PACKAGE(port)
FF_PRINT_PACKAGE(scoop)
FF_PRINT_PACKAGE(choco)
FF_PRINT_PACKAGE(pkgtool)
//Fix linter warning of unused value of all
(void) all;