} distro;
};
+/*
+ This is a list of all features that are supported by this version of Pakfire
+*/
+static const struct pakfire_feature {
+ const char* name;
+} features[] = {
+ { "Compress-Zstandard" },
+ { NULL },
+};
+
static const struct pakfire_mountpoint {
const char* source;
const char* target;
DEBUG(pakfire, "pool: %s", s);
}
+static Id pakfire_namespace_callback(Pool* pool, void* data, Id ns, Id id) {
+ Pakfire pakfire = (Pakfire)data;
+
+ const char* namespace = pool_id2str(pool, ns);
+ const char* name = pool_dep2str(pool, id);
+
+ DEBUG(pakfire, "Namespace callback called for %s(%s)\n", namespace, name);
+
+ // We only handle the pakfire namesapce
+ if (strcmp(namespace, "pakfire") != 0)
+ return 0;
+
+ // Find all supported features
+ for (const struct pakfire_feature* feature = features; feature->name; feature++) {
+ if (strcmp(feature->name, name) == 0)
+ return 1;
+ }
+
+ // Not supported
+ return 0;
+}
+
static int pakfire_populate_pool(Pakfire pakfire) {
struct pakfire_db* db;
PakfireRepo repo = NULL;
// Set debug callback
pool_setdebugcallback(pool, pool_log, pakfire);
+ // Install namespace callback
+ pool_setnamespacecallback(pool, pakfire_namespace_callback, pakfire);
+
// Open database in read-only mode and try to load all installed packages
r = pakfire_db_open(&db, pakfire, PAKFIRE_DB_READWRITE);
if (r)