#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) // clang-format off #include "src/core/package.hpp" #include // SQLite::{Database, OPEN_READONLY} #include // SQLite::Exception #include // SQLite::Statement #include // glz::write_beve #include // glz::object #include // glz::detail::Object #include "src/util/defs.hpp" // clang-format on namespace package { #if defined(__FreeBSD__) || defined(__DragonFly__) fn GetPkgNgCount() -> Result { const PackageManagerInfo pkgInfo = { .id = "pkgng", // Use core struct .dbPath = "/var/db/pkg/local.sqlite", .countQuery = "SELECT COUNT(*) FROM packages", }; return GetCountFromDb(pkgInfo); } #elif defined(__NetBSD__) fn GetPkgSrcCount() -> Result { return GetCountFromDirectory("pkgsrc", fs::current_path().root_path() / "usr" / "pkg" / "pkgdb", true); } #endif } // namespace package #endif // __FreeBSD__ || __DragonFly__ || __NetBSD__