mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 07:44:06 +01:00
Packages (Linux): detects rum overlay packages (#2597)
This commit is contained in:
@@ -44,6 +44,7 @@ typedef struct FFPackagesResult {
|
||||
uint32_t pkgtool;
|
||||
uint32_t porg;
|
||||
uint32_t rpm;
|
||||
uint32_t rum;
|
||||
uint32_t scoopGlobal;
|
||||
uint32_t scoopUser;
|
||||
uint32_t snap;
|
||||
|
||||
@@ -528,6 +528,9 @@ static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* packageCounts,
|
||||
// `Sigmd5` is the only table that doesn't contain the virtual `gpg-pubkey` package
|
||||
packageCounts->rpm += getSQLite3Int(baseDir, "/var/lib/rpm/rpmdb.sqlite", "SELECT count(*) FROM Sigmd5", "rpm");
|
||||
}
|
||||
if (FF_PACKAGES_IS_ENABLED(options, RUM)) {
|
||||
packageCounts->rum += getSQLite3Int(baseDir, "/var/lib/rakuos/rum-rpmdb/rpmdb.sqlite", "SELECT count(*) FROM Sigmd5", "rum");
|
||||
}
|
||||
if (FF_PACKAGES_IS_ENABLED(options, SNAP)) {
|
||||
packageCounts->snap += getSnap(baseDir);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ typedef enum FFPackagesFlags: uint64_t {
|
||||
FF_PACKAGES_FLAG_PORG_BIT = UINT64_C(1) << 35U,
|
||||
FF_PACKAGES_FLAG_INSTALLRELEASE_BIT = UINT64_C(1) << 36U,
|
||||
FF_PACKAGES_FLAG_CRUX_BIT = UINT64_C(1) << 37U,
|
||||
FF_PACKAGES_FLAG_RUM_BIT = UINT64_C(1) << 38U,
|
||||
} FFPackagesFlags;
|
||||
static_assert(sizeof(FFPackagesFlags) == sizeof(uint64_t), "");
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ bool ffPrintPackages(FFPackagesOptions* options) {
|
||||
FF_PRINT_PACKAGE(pkgtool)
|
||||
FF_PRINT_PACKAGE(porg)
|
||||
FF_PRINT_PACKAGE(rpm)
|
||||
FF_PRINT_PACKAGE(rum)
|
||||
if (options->combined) {
|
||||
FF_PRINT_PACKAGE_ALL(scoop);
|
||||
} else if (counts.scoopGlobal > 0) {
|
||||
@@ -188,6 +189,7 @@ bool ffPrintPackages(FFPackagesOptions* options) {
|
||||
FF_ARG(counts.pkgtool, "pkgtool"),
|
||||
FF_ARG(counts.porg, "porg"),
|
||||
FF_ARG(counts.rpm, "rpm"),
|
||||
FF_ARG(counts.rum, "rum"),
|
||||
FF_ARG(counts.scoopGlobal, "scoop-global"),
|
||||
FF_ARG(counts.scoopUser, "scoop-user"),
|
||||
FF_ARG(counts.snap, "snap"),
|
||||
@@ -337,6 +339,7 @@ void ffParsePackagesJsonObject(FFPackagesOptions* options, yyjson_val* module) {
|
||||
if (false)
|
||||
;
|
||||
FF_TEST_PACKAGE_NAME(RPM)
|
||||
FF_TEST_PACKAGE_NAME(RUM)
|
||||
break;
|
||||
case 'S':
|
||||
if (false)
|
||||
@@ -418,6 +421,7 @@ void ffGeneratePackagesJsonConfig(FFPackagesOptions* options, yyjson_mut_doc* do
|
||||
FF_TEST_PACKAGE_NAME(PKGTOOL)
|
||||
FF_TEST_PACKAGE_NAME(PORG)
|
||||
FF_TEST_PACKAGE_NAME(RPM)
|
||||
FF_TEST_PACKAGE_NAME(RUM)
|
||||
FF_TEST_PACKAGE_NAME(SCOOP)
|
||||
FF_TEST_PACKAGE_NAME(SNAP)
|
||||
FF_TEST_PACKAGE_NAME(SOAR)
|
||||
@@ -487,6 +491,7 @@ bool ffGeneratePackagesJsonResult(FFPackagesOptions* options, yyjson_mut_doc* do
|
||||
FF_APPEND_PACKAGE_COUNT(pkgtool)
|
||||
FF_APPEND_PACKAGE_COUNT(porg)
|
||||
FF_APPEND_PACKAGE_COUNT(rpm)
|
||||
FF_APPEND_PACKAGE_COUNT(rum)
|
||||
FF_APPEND_PACKAGE_COUNT(scoopGlobal)
|
||||
FF_APPEND_PACKAGE_COUNT(scoopUser)
|
||||
FF_APPEND_PACKAGE_COUNT(snap)
|
||||
@@ -587,6 +592,7 @@ FFModuleBaseInfo ffPackagesModuleInfo = {
|
||||
{ "Number of pkgtool packages", "pkgtool" },
|
||||
{ "Number of porg packages", "porg" },
|
||||
{ "Number of rpm packages", "rpm" },
|
||||
{ "Number of rum overlay packages", "rum" },
|
||||
{ "Number of scoop-global packages", "scoop-global" },
|
||||
{ "Number of scoop-user packages", "scoop-user" },
|
||||
{ "Number of snap packages", "snap" },
|
||||
|
||||
Reference in New Issue
Block a user