From 7162fe27160efe13ae545a2b6c91097a2bd2e502 Mon Sep 17 00:00:00 2001 From: Jan-Michael Brummer Date: Wed, 3 May 2023 14:40:55 +0200 Subject: Add PX_FORCE_CONFIG env Allow users to enforce a specific config plugin using PX_FORCE_CONFIG=plugin-name Fixes: https://github.com/libproxy/libproxy/issues/174 --- src/backend/px-manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/px-manager.c b/src/backend/px-manager.c index 1eab303..4a54352 100644 --- a/src/backend/px-manager.c +++ b/src/backend/px-manager.c @@ -138,8 +138,10 @@ px_manager_add_config_plugin (PxManager *self, { PxConfig *config = g_object_new (type, "config-option", self->config_option, NULL); PxConfigInterface *ifc = PX_CONFIG_GET_IFACE (config); + const char *env = g_getenv ("PX_FORCE_CONFIG"); + const char *force_config = self->config_plugin ? self->config_plugin : env; - if (!self->config_plugin || g_strcmp0 (ifc->name, self->config_plugin) == 0) + if (!force_config || g_strcmp0 (ifc->name, force_config) == 0) self->config_plugins = g_list_insert_sorted (self->config_plugins, config, config_order_compare); } -- cgit v1.2.1