From 3f41306c9170747009afaba9d64b45aee8f3fbc6 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 30 Oct 2024 22:42:46 +0800 Subject: [PATCH] Packages (NetBSD): add support --- CMakeLists.txt | 2 +- src/detection/packages/packages_obsd.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be038300b..f024d55a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -724,7 +724,7 @@ elseif(NetBSD) src/detection/netio/netio_nosupport.c src/detection/opengl/opengl_linux.c src/detection/os/os_nbsd.c - src/detection/packages/packages_nosupport.c + src/detection/packages/packages_obsd.c src/detection/poweradapter/poweradapter_nosupport.c src/detection/processes/processes_nosupport.c src/detection/gtk_qt/qt.c diff --git a/src/detection/packages/packages_obsd.c b/src/detection/packages/packages_obsd.c index c7fadcbdf..79d383ed4 100644 --- a/src/detection/packages/packages_obsd.c +++ b/src/detection/packages/packages_obsd.c @@ -26,6 +26,12 @@ void ffDetectPackagesImpl(FFPackagesResult* result, FFPackagesOptions* options) { if (!(options->disabled & FF_PACKAGES_FLAG_PKG_BIT)) { - result->pkg = getNumElementsImpl(FASTFETCH_TARGET_DIR_ROOT "/var/db/pkg", DT_DIR); + result->pkg = getNumElementsImpl(FASTFETCH_TARGET_DIR_ROOT + #if __OpenBSD + "/var/db/pkg" + #else + "/usr/pkg/pkgdb" + #endif + , DT_DIR); } }