From f5f9a6c2a11edf4f8bf547848f3ee96999e64bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 27 Jun 2026 09:15:39 +0800 Subject: [PATCH 1/3] GPU (Intel): improves performance slightly --- src/detection/gpu/gpu_intel.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/detection/gpu/gpu_intel.c b/src/detection/gpu/gpu_intel.c index 474f798398..2b490209da 100644 --- a/src/detection/gpu/gpu_intel.c +++ b/src/detection/gpu/gpu_intel.c @@ -65,19 +65,16 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe return "loading igcl library failed"; } - uint32_t deviceCount = 0; - if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, NULL)) { - return "ctlEnumerateDevices(NULL) failed"; + ctl_device_adapter_handle_t devices[64]; + uint32_t deviceCount = ARRAY_SIZE(devices); + if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, devices)) { + return "ctlEnumerateDevices(devices) failed"; } + if (deviceCount == 0) { return "No Intel graphics adapter found"; } - FF_AUTO_FREE ctl_device_adapter_handle_t* devices = malloc(deviceCount * sizeof(*devices)); - if (igclData.ffctlEnumerateDevices(igclData.apiHandle, &deviceCount, devices)) { - return "ctlEnumerateDevices(devices) failed"; - } - ctl_device_adapter_handle_t device = NULL; uint64_t /* LUID */ deviceId = 0; From 062e4afccc9fa8b9481a943dbc63f9ae2ad655d7 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sat, 27 Jun 2026 08:13:00 +0800 Subject: [PATCH 2/3] GPU: detects PCIe speed only in `driverSpecific` mode Fixes #2419 --- src/detection/gpu/gpu.h | 3 ++ src/detection/gpu/gpu_linux.c | 62 ++++++++++++------------ src/detection/gpu/gpu_windows.c | 83 +++++++++++++++++++-------------- 3 files changed, 82 insertions(+), 66 deletions(-) diff --git a/src/detection/gpu/gpu.h b/src/detection/gpu/gpu.h index e993b512e5..84e1467a15 100644 --- a/src/detection/gpu/gpu.h +++ b/src/detection/gpu/gpu.h @@ -64,6 +64,9 @@ typedef struct FFGPUResult { uint64_t deviceId; } FFGPUResult; +static_assert(sizeof(((FFGPUResult*) NULL)->pcieSpeed) == 8, "pcieSpeed is not 8 bytes"); +static_assert(sizeof(((FFGPUResult*) NULL)->psMax) == 4, "psMax has padding"); + const char* ffDetectGPU(const FFGPUOptions* options, FFlist* result); const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus); diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 8cadb9e31e..7183b903bf 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -410,34 +410,6 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf pciDetectDriver(&gpu->driver, deviceDir, buffer, drmKey); ffStrbufSubstrBefore(deviceDir, drmDirPathLength); - ffStrbufAppendS(deviceDir, "/max_link_speed"); - if (ffReadFileBuffer(deviceDir->chars, buffer)) { - gpu->psMax.gen = pcieLinkSpeedToGen(buffer); - } - ffStrbufSubstrBefore(deviceDir, drmDirPathLength); - - if (gpu->psMax.gen != FF_GPU_PCIE_SPEED_UNSET) { - ffStrbufAppendS(deviceDir, "/max_link_width"); - if (ffReadFileBuffer(deviceDir->chars, buffer)) { - gpu->psMax.lanes = pcieWidthToLanes(buffer); - } - ffStrbufSubstrBefore(deviceDir, drmDirPathLength); - } - - ffStrbufAppendS(deviceDir, "/current_link_speed"); - if (ffReadFileBuffer(deviceDir->chars, buffer)) { - gpu->psCurr.gen = pcieLinkSpeedToGen(buffer); - } - ffStrbufSubstrBefore(deviceDir, drmDirPathLength); - - if (gpu->psCurr.gen != FF_GPU_PCIE_SPEED_UNSET) { - ffStrbufAppendS(deviceDir, "/current_link_width"); - if (ffReadFileBuffer(deviceDir->chars, buffer)) { - gpu->psCurr.lanes = pcieWidthToLanes(buffer); - } - ffStrbufSubstrBefore(deviceDir, drmDirPathLength); - } - if (gpu->vendor.chars == FF_GPU_VENDOR_NAME_AMD) { bool ok = false; if (drmKey && options->driverSpecific) { @@ -473,7 +445,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf pciDetectTempGeneral(options, gpu, deviceDir, buffer); pciDetectZxSpecific(options, gpu, deviceDir, buffer); } else { - ffGPUDetectDriverSpecific(options, gpu, (FFGpuDriverPciBusId) { + ffGPUDetectDriverSpecific(options, gpu, (FFGpuDriverPciBusId){ .domain = pciDomain, .bus = pciBus, .device = pciDevice, @@ -487,11 +459,41 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf ffGPUFillVendorByDeviceName(gpu); + if (options->driverSpecific && gpu->pcieSpeed == FF_GPU_PCIE_SPEED_UNSET) { + ffStrbufAppendS(deviceDir, "/max_link_speed"); + if (ffReadFileBuffer(deviceDir->chars, buffer)) { + gpu->psMax.gen = pcieLinkSpeedToGen(buffer); + } + ffStrbufSubstrBefore(deviceDir, drmDirPathLength); + + if (gpu->psMax.gen != FF_GPU_PCIE_SPEED_UNSET) { + ffStrbufAppendS(deviceDir, "/max_link_width"); + if (ffReadFileBuffer(deviceDir->chars, buffer)) { + gpu->psMax.lanes = pcieWidthToLanes(buffer); + } + ffStrbufSubstrBefore(deviceDir, drmDirPathLength); + } + + ffStrbufAppendS(deviceDir, "/current_link_speed"); + if (ffReadFileBuffer(deviceDir->chars, buffer)) { + gpu->psCurr.gen = pcieLinkSpeedToGen(buffer); + } + ffStrbufSubstrBefore(deviceDir, drmDirPathLength); + + if (gpu->psCurr.gen != FF_GPU_PCIE_SPEED_UNSET) { + ffStrbufAppendS(deviceDir, "/current_link_width"); + if (ffReadFileBuffer(deviceDir->chars, buffer)) { + gpu->psCurr.lanes = pcieWidthToLanes(buffer); + } + ffStrbufSubstrBefore(deviceDir, drmDirPathLength); + } + } + return NULL; } #if __aarch64__ -#include "detection/cpu/cpu.h" + #include "detection/cpu/cpu.h" FF_A_UNUSED static const char* drmDetectAsahiSpecific(FFGPUResult* gpu, const char* name, FF_A_UNUSED FFstrbuf* buffer, FF_A_UNUSED const char* drmKey) { if (sscanf(name, "agx-t%lu", &gpu->deviceId) == 1) { diff --git a/src/detection/gpu/gpu_windows.c b/src/detection/gpu/gpu_windows.c index 18f07d2d56..c50cfecdb8 100644 --- a/src/detection/gpu/gpu_windows.c +++ b/src/detection/gpu/gpu_windows.c @@ -21,7 +21,7 @@ #define GUID_DEVCLASS_DISPLAY_STRING L"{4d36e968-e325-11ce-bfc1-08002be10318}" // Found in -static bool queryPciDeviceInfo(FFGPUResult* gpu, D3DKMT_DEVICE_IDS* outDeviceIds) { +static bool queryPciDeviceInfo(FFGPUResult* gpu, D3DKMT_DEVICE_IDS* outDeviceIds, bool queryPcieGen) { FF_DEBUG("Query PCI device info: %08llX", gpu->deviceId); static FFlist deviceIdsCache; @@ -107,42 +107,44 @@ static bool queryPciDeviceInfo(FFGPUResult* gpu, D3DKMT_DEVICE_IDS* outDeviceIds FF_DEBUG("Failed to get PCI bus number"); } - DEVPROPTYPE propType; + if (queryPcieGen) { + DEVPROPTYPE propType; - pciBufLen = sizeof(entry->maxLinkSpeed); - // Reports PCEe gen despite the PKEY name - CONFIGRET ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_MaxLinkSpeed, &propType, (PBYTE) &entry->maxLinkSpeed, &pciBufLen, 0); - if (ret == CR_SUCCESS) { - FF_DEBUG("PCIe max GEN: %u", entry->maxLinkSpeed); - } else { - FF_DEBUG("Failed to get PCIe max GEN: %s", ffDebugConfigRet(ret)); - } - - if (entry->maxLinkSpeed != FF_GPU_PCIE_SPEED_UNSET) { - pciBufLen = sizeof(entry->maxLinkWidth); - ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_MaxLinkWidth, &propType, (PBYTE) &entry->maxLinkWidth, &pciBufLen, 0); + pciBufLen = sizeof(entry->maxLinkSpeed); + // Reports PCEe gen despite the PKEY name + CONFIGRET ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_MaxLinkSpeed, &propType, (PBYTE) &entry->maxLinkSpeed, &pciBufLen, 0); if (ret == CR_SUCCESS) { - FF_DEBUG("PCIe max link width: %u", entry->maxLinkWidth); + FF_DEBUG("PCIe max GEN: %u", entry->maxLinkSpeed); } else { - FF_DEBUG("Failed to get PCIe max link width: %s", ffDebugConfigRet(ret)); + FF_DEBUG("Failed to get PCIe max GEN: %s", ffDebugConfigRet(ret)); } - } - pciBufLen = sizeof(entry->currentLinkSpeed); - ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_CurrentLinkSpeed, &propType, (PBYTE) &entry->currentLinkSpeed, &pciBufLen, 0); - if (ret == CR_SUCCESS) { - FF_DEBUG("PCIe GEN: %u", entry->currentLinkSpeed); - } else { - FF_DEBUG("Failed to get PCIe GEN: %s", ffDebugConfigRet(ret)); - } + if (entry->maxLinkSpeed != FF_GPU_PCIE_SPEED_UNSET) { + pciBufLen = sizeof(entry->maxLinkWidth); + ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_MaxLinkWidth, &propType, (PBYTE) &entry->maxLinkWidth, &pciBufLen, 0); + if (ret == CR_SUCCESS) { + FF_DEBUG("PCIe max link width: %u", entry->maxLinkWidth); + } else { + FF_DEBUG("Failed to get PCIe max link width: %s", ffDebugConfigRet(ret)); + } + } - if (entry->currentLinkSpeed != FF_GPU_PCIE_SPEED_UNSET) { - pciBufLen = sizeof(entry->currentLinkWidth); - ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_CurrentLinkWidth, &propType, (PBYTE) &entry->currentLinkWidth, &pciBufLen, 0); + pciBufLen = sizeof(entry->currentLinkSpeed); + ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_CurrentLinkSpeed, &propType, (PBYTE) &entry->currentLinkSpeed, &pciBufLen, 0); if (ret == CR_SUCCESS) { - FF_DEBUG("PCIe current link width: %u", entry->currentLinkWidth); + FF_DEBUG("PCIe GEN: %u", entry->currentLinkSpeed); } else { - FF_DEBUG("Failed to get PCIe current link width: %s", ffDebugConfigRet(ret)); + FF_DEBUG("Failed to get PCIe GEN: %s", ffDebugConfigRet(ret)); + } + + if (entry->currentLinkSpeed != FF_GPU_PCIE_SPEED_UNSET) { + pciBufLen = sizeof(entry->currentLinkWidth); + ret = CM_Get_DevNode_PropertyW(devInst, &DEVPKEY_PciDevice_CurrentLinkWidth, &propType, (PBYTE) &entry->currentLinkWidth, &pciBufLen, 0); + if (ret == CR_SUCCESS) { + FF_DEBUG("PCIe current link width: %u", entry->currentLinkWidth); + } else { + FF_DEBUG("Failed to get PCIe current link width: %s", ffDebugConfigRet(ret)); + } } } } @@ -154,10 +156,13 @@ static bool queryPciDeviceInfo(FFGPUResult* gpu, D3DKMT_DEVICE_IDS* outDeviceIds if (outDeviceIds->VendorID != -1u) { *outDeviceIds = entry->deviceIds; } - gpu->psMax.gen = (uint16_t) entry->maxLinkSpeed; - gpu->psMax.lanes = (uint16_t) entry->maxLinkWidth; - gpu->psCurr.gen = (uint16_t) entry->currentLinkSpeed; - gpu->psCurr.lanes = (uint16_t) entry->currentLinkWidth; + + if (queryPcieGen) { + gpu->psMax.gen = (uint16_t) entry->maxLinkSpeed; + gpu->psMax.lanes = (uint16_t) entry->maxLinkWidth; + gpu->psCurr.gen = (uint16_t) entry->currentLinkSpeed; + gpu->psCurr.lanes = (uint16_t) entry->currentLinkWidth; + } return true; } } @@ -371,9 +376,9 @@ ffGPUDetectWsl2 FF_DEBUG("KMTQAITYPE_PHYSICALADAPTERDEVICEIDS query failed for adapter #%u: %s", i, ffDebugNtStatus(status)); } - #if _WIN32 - if (adapterAddress.BusNumber != -1u) { - if (queryPciDeviceInfo(gpu, &deviceIds.DeviceIds) && gpu->vendor.length == 0) { + #if _WIN32 && FF_WIN81_COMPAT + if (adapterAddress.BusNumber != -1u && (deviceIds.DeviceIds.VendorID == -1u || options->driverSpecific)) { + if (queryPciDeviceInfo(gpu, &deviceIds.DeviceIds, options->driverSpecific) && gpu->vendor.length == 0) { ffStrbufSetStatic(&gpu->vendor, ffGPUGetVendorString(deviceIds.DeviceIds.VendorID)); } } @@ -448,6 +453,12 @@ ffGPUDetectWsl2 FF_DEBUG("Attempting to query vendor name via registry for adapter #%u", i); queryVendorNameViaRegistry(&gpu->vendor, adapter->hAdapter); } + + #if !FF_WIN81_COMPAT + if (adapterAddress.BusNumber != -1u && options->driverSpecific && gpu->pcieSpeed == FF_GPU_PCIE_SPEED_UNSET) { + queryPciDeviceInfo(gpu, &deviceIds.DeviceIds, options->driverSpecific); + } + #endif #endif if (gpu->name.length == 0) { From 5278d5bf51695f9a178e3ea94a693628cbd850ad Mon Sep 17 00:00:00 2001 From: aliriza Date: Sat, 27 Jun 2026 10:19:14 +0300 Subject: [PATCH 3/3] add ymp package support --- doc/json_schema.json | 2 +- src/detection/packages/packages.h | 1 + src/detection/packages/packages_linux.c | 3 +++ src/modules/packages/option.h | 1 + src/modules/packages/packages.c | 10 ++++++++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/json_schema.json b/doc/json_schema.json index e9271b2ff7..c1835de157 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -446,7 +446,7 @@ "type": "string" }, "packagesFormat": { - "description": "Output format for the `Packages` module. See Wiki for formatting syntax\n 1. {am-system}: Number of am-system packages\n 2. {am-user}: Number of am-user (aka appman) packages\n 3. {appimage}: Number of appimage packages\n 4. {apk}: Number of apk packages\n 5. {brew}: Number of brew packages\n 6. {brew-cask}: Number of brew-cask packages\n 7. {cards}: Number of cards packages\n 8. {choco}: Number of choco packages\n 9. {dpkg}: Number of dpkg packages\n 10. {emerge}: Number of emerge packages\n 11. {eopkg}: Number of eopkg packages\n 12. {flatpak-system}: Number of flatpak-system app packages\n 13. {flatpak-user}: Number of flatpak-user app packages\n 14. {guix-home}: Number of guix-home packages\n 15. {guix-system}: Number of guix-system packages\n 16. {guix-user}: Number of guix-user packages\n 17. {hpkg-system}: Number of hpkg-system packages\n 18. {hpkg-user}: Number of hpkg-user packages\n 19. {install-release}: Number of install-release packages\n 20. {kiss}: Number of kiss packages\n 21. {linglong}: Number of linglong packages\n 22. {lpkg}: Number of lpkg packages\n 23. {lpkgbuild}: Number of lpkgbuild packages\n 24. {macports}: Number of macports packages\n 25. {mport}: Number of mport packages\n 26. {moss}: Number of moss packages\n 27. {nix-default}: Number of nix-default packages\n 28. {nix-system}: Number of nix-system packages\n 29. {nix-user}: Number of nix-user packages\n 30. {opkg}: Number of opkg packages\n 31. {pacman}: Number of pacman packages\n 32. {pacman-branch}: Pacman branch on manjaro\n 33. {pacstall}: Number of pacstall packages\n 34. {paludis}: Number of paludis packages\n 35. {pisi}: Number of pisi packages\n 36. {pkg}: Number of pkg packages\n 37. {pkgsrc}: Number of pkgsrc packages\n 38. {pkgtool}: Number of pkgtool packages\n 39. {porg}: Number of porg packages\n 40. {rpm}: Number of rpm packages\n 41. {scoop-global}: Number of scoop-global packages\n 42. {scoop-user}: Number of scoop-user packages\n 43. {snap}: Number of snap packages\n 44. {soar}: Number of soar packages\n 45. {sorcery}: Number of sorcery packages\n 46. {winget}: Number of winget packages\n 47. {xbps}: Number of xbps packages\n 48. {brew-all}: Total number of all brew packages\n 49. {flatpak-all}: Total number of all flatpak app packages\n 50. {guix-all}: Total number of all guix packages\n 51. {hpkg-all}: Total number of all hpkg packages\n 52. {nix-all}: Total number of all nix packages\n 53. {all}: Number of all packages", + "description": "Output format for the `Packages` module. See Wiki for formatting syntax\n 1. {am-system}: Number of am-system packages\n 2. {am-user}: Number of am-user (aka appman) packages\n 3. {appimage}: Number of appimage packages\n 4. {apk}: Number of apk packages\n 5. {brew}: Number of brew packages\n 6. {brew-cask}: Number of brew-cask packages\n 7. {cards}: Number of cards packages\n 8. {choco}: Number of choco packages\n 9. {dpkg}: Number of dpkg packages\n 10. {emerge}: Number of emerge packages\n 11. {eopkg}: Number of eopkg packages\n 12. {flatpak-system}: Number of flatpak-system app packages\n 13. {flatpak-user}: Number of flatpak-user app packages\n 14. {guix-home}: Number of guix-home packages\n 15. {guix-system}: Number of guix-system packages\n 16. {guix-user}: Number of guix-user packages\n 17. {hpkg-system}: Number of hpkg-system packages\n 18. {hpkg-user}: Number of hpkg-user packages\n 19. {install-release}: Number of install-release packages\n 20. {kiss}: Number of kiss packages\n 21. {linglong}: Number of linglong packages\n 22. {lpkg}: Number of lpkg packages\n 23. {lpkgbuild}: Number of lpkgbuild packages\n 24. {macports}: Number of macports packages\n 25. {mport}: Number of mport packages\n 26. {moss}: Number of moss packages\n 27. {nix-default}: Number of nix-default packages\n 28. {nix-system}: Number of nix-system packages\n 29. {nix-user}: Number of nix-user packages\n 30. {opkg}: Number of opkg packages\n 31. {pacman}: Number of pacman packages\n 32. {pacman-branch}: Pacman branch on manjaro\n 33. {pacstall}: Number of pacstall packages\n 34. {paludis}: Number of paludis packages\n 35. {pisi}: Number of pisi packages\n 36. {pkg}: Number of pkg packages\n 37. {pkgsrc}: Number of pkgsrc packages\n 38. {pkgtool}: Number of pkgtool packages\n 39. {porg}: Number of porg packages\n 40. {rpm}: Number of rpm packages\n 41. {scoop-global}: Number of scoop-global packages\n 42. {scoop-user}: Number of scoop-user packages\n 43. {snap}: Number of snap packages\n 44. {soar}: Number of soar packages\n 45. {sorcery}: Number of sorcery packages\n 46. {winget}: Number of winget packages\n 47. {xbps}: Number of xbps packages\n 48. {brew-all}: Total number of all brew packages\n 49. {flatpak-all}: Total number of all flatpak app packages\n 50. {guix-all}: Total number of all guix packages\n 51. {hpkg-all}: Total number of all hpkg packages\n 52. {nix-all}: Total number of all nix packages\n 53. {ymp}: Number of ymp packages\n 54. {all}: Number of all packages", "type": "string" }, "physicaldiskFormat": { diff --git a/src/detection/packages/packages.h b/src/detection/packages/packages.h index 2119349323..e5117728ec 100644 --- a/src/detection/packages/packages.h +++ b/src/detection/packages/packages.h @@ -50,6 +50,7 @@ typedef struct FFPackagesResult { uint32_t sorcery; uint32_t winget; uint32_t xbps; + uint32_t ymp; uint32_t all; // Make sure this goes last diff --git a/src/detection/packages/packages_linux.c b/src/detection/packages/packages_linux.c index ee4efbe4ce..c940b5a662 100644 --- a/src/detection/packages/packages_linux.c +++ b/src/detection/packages/packages_linux.c @@ -531,6 +531,9 @@ static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* packageCounts, if (FF_PACKAGES_IS_ENABLED(options, XBPS)) { packageCounts->xbps += getXBPS(baseDir, "/var/db/xbps"); } + if (FF_PACKAGES_IS_ENABLED(options, YMP)) { + packageCounts->ymp += getNumElements(baseDir, "/var/lib/ymp/metadata", false); + } if (FF_PACKAGES_IS_ENABLED(options, BREW)) { packageCounts->brewCask += getNumElements(baseDir, "/home/linuxbrew/.linuxbrew/Caskroom", true); packageCounts->brew += getNumElements(baseDir, "/home/linuxbrew/.linuxbrew/Cellar", true); diff --git a/src/modules/packages/option.h b/src/modules/packages/option.h index c215593c21..b6ab3da1a6 100644 --- a/src/modules/packages/option.h +++ b/src/modules/packages/option.h @@ -41,6 +41,7 @@ typedef enum FF_A_PACKED FFPackagesFlags { FF_PACKAGES_FLAG_CARDS_BIT = UINT64_C(1) << 34U, FF_PACKAGES_FLAG_PORG_BIT = UINT64_C(1) << 35U, FF_PACKAGES_FLAG_INSTALLRELEASE_BIT = UINT64_C(1) << 36U, + FF_PACKAGES_FLAG_YMP_BIT = UINT64_C(1) << 37U, FF_PACKAGES_FLAG_FORCE_UNSIGNED = UINT64_MAX, } FFPackagesFlags; static_assert(sizeof(FFPackagesFlags) == sizeof(uint64_t), ""); diff --git a/src/modules/packages/packages.c b/src/modules/packages/packages.c index 8cb4027bde..6d6c5ddd80 100644 --- a/src/modules/packages/packages.c +++ b/src/modules/packages/packages.c @@ -135,6 +135,7 @@ bool ffPrintPackages(FFPackagesOptions* options) { FF_PRINT_PACKAGE(sorcery) FF_PRINT_PACKAGE(winget) FF_PRINT_PACKAGE(xbps) + FF_PRINT_PACKAGE(ymp) assert(output.length >= 2); // counts.all > 0 guarantees that at least one package count was printed, which guarantees that ", " was appended at least once ffStrbufSubstrBefore(&output, output.length - 1); @@ -193,6 +194,7 @@ bool ffPrintPackages(FFPackagesOptions* options) { FF_ARG(counts.sorcery, "sorcery"), FF_ARG(counts.winget, "winget"), FF_ARG(counts.xbps, "xbps"), + FF_ARG(counts.ymp, "ymp"), FF_ARG(brewAll, "brew-all"), FF_ARG(flatpakAll, "flatpak-all"), @@ -353,6 +355,11 @@ void ffParsePackagesJsonObject(FFPackagesOptions* options, yyjson_val* module) { ; FF_TEST_PACKAGE_NAME(XBPS) break; + case 'Y': + if (false) + ; + FF_TEST_PACKAGE_NAME(YMP) + break; } #undef FF_TEST_PACKAGE_NAME } @@ -420,6 +427,7 @@ void ffGeneratePackagesJsonConfig(FFPackagesOptions* options, yyjson_mut_doc* do FF_TEST_PACKAGE_NAME(SORCERY) FF_TEST_PACKAGE_NAME(WINGET) FF_TEST_PACKAGE_NAME(XBPS) + FF_TEST_PACKAGE_NAME(YMP) #undef FF_TEST_PACKAGE_NAME #endif @@ -489,6 +497,7 @@ bool ffGeneratePackagesJsonResult(FFPackagesOptions* options, yyjson_mut_doc* do FF_APPEND_PACKAGE_COUNT(sorcery) FF_APPEND_PACKAGE_COUNT(winget) FF_APPEND_PACKAGE_COUNT(xbps) + FF_APPEND_PACKAGE_COUNT(ymp) if (counts.pacmanBranch.length > 0) { yyjson_mut_obj_add_strbuf(doc, obj, "pacmanBranch", &counts.pacmanBranch); } @@ -566,6 +575,7 @@ FFModuleBaseInfo ffPackagesModuleInfo = { { "Number of sorcery packages", "sorcery" }, { "Number of winget packages", "winget" }, { "Number of xbps packages", "xbps" }, + { "Number of ymp packages", "ymp" }, { "Total number of all brew packages", "brew-all" }, { "Total number of all flatpak app packages", "flatpak-all" },