src/cli/lib/color.h \
src/cli/lib/command.c \
src/cli/lib/command.h \
+ src/cli/lib/config.c \
+ src/cli/lib/config.h \
src/cli/lib/dist.c \
src/cli/lib/dist.h \
src/cli/lib/dump.c \
# Proxy (HTTPS + HTTP)
#proxy = http://192.168.180.1:800
+# Build Configuration
+[build]
+distro = ipfire3
+
# Pakfire Client Configuration
[client]
--- /dev/null
+/*#############################################################################
+# #
+# Pakfire - The IPFire package management system #
+# Copyright (C) 2023 Pakfire development team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#include <pakfire/ctx.h>
+#include <pakfire/config.h>
+
+#include "config.h"
+
+const char* cli_get_default_distro(struct pakfire_ctx* ctx) {
+ struct pakfire_config* config = NULL;
+ const char* distro = NULL;
+
+#if 0
+ // Fetch the configuration
+ config = pakfire_ctx_get_config(ctx);
+ if (!config)
+ return NULL;
+
+ // Fetch the distro
+ distro = pakfire_config_get(config, "build", "distro", NULL);
+
+ // Cleanup
+ if (config)
+ pakfire_config_unref(config);
+#endif
+
+ return distro;
+}
--- /dev/null
+/*#############################################################################
+# #
+# Pakfire - The IPFire package management system #
+# Copyright (C) 2023 Pakfire development team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#ifndef PAKFIRE_CLI_CONFIG_H
+#define PAKFIRE_CLI_CONFIG_H
+
+#include <pakfire/ctx.h>
+
+const char* cli_get_default_distro(struct pakfire_ctx* ctx);
+
+#endif /* PAKFIRE_CLI_CONFIG_H */
#include "lib/build.h"
#include "lib/clean.h"
#include "lib/command.h"
+#include "lib/config.h"
#include "lib/dist.h"
#include "lib/image.h"
#include "lib/info.h"
struct cli_config config = {
.ctx = ctx,
- // XXX hard-coded distro
- .distro = "ipfire3",
+ .distro = cli_get_default_distro(ctx),
.arch = NULL,
.flags = PAKFIRE_FLAGS_BUILD,
};
struct cli_config config = {
.ctx = ctx,
+ .distro = cli_get_default_distro(ctx),
};
// Parse the command line and run any commands