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
7 changed files with 13 additions and 5 deletions
+1
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;
+1
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");
+3 -2
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)
+1
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;