feat(daemon): uninstall manifest-owned files on request
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 8s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 9s

This commit is contained in:
faumaray committed 2026-12-04 03:18:42 +03:00
1 parent 2c602fc3e7
commit 716c049cff
8 files changed
+63 -6

No files matched your search

+12
View File
@@ -1616,6 +1616,13 @@ int execute_daemon_command(std::string_view sub, const DaemonCmdOptions &opts) {
request_json = opts.pack_output_arg ? std::format(R"({{"op":"pack","output":{}}})",
Util::json_quote(*opts.pack_output_arg))
: R"({"op":"pack"})";
} else if (sub == "uninstall") {
if (!opts.prefix_arg || opts.prefix_arg->empty()) {
std::cerr << "vbs daemon uninstall: --prefix is required\n";
return 2;
}
request_json =
std::format(R"({{"op":"uninstall","prefix":{}}})", Util::json_quote(*opts.prefix_arg));
} else if (sub == "install") {
if (!opts.prefix_arg || opts.prefix_arg->empty()) {
std::cerr << "vbs daemon install: --prefix is required\n";
@@ -2782,6 +2789,11 @@ int main(int argc, char **argv) {
daemon_install_cmd.option("--prefix", "", "Install prefix (required)", daemon_opts.prefix_arg)
.option_default("--package-version", "", "Exported package version",
daemon_opts.package_version_arg, "0.1.0");
auto &daemon_uninstall_cmd =
daemon_cmd.subcommand("uninstall", "Remove VBS-owned installed files via the daemon");
configure_daemon_common(daemon_uninstall_cmd);
daemon_uninstall_cmd.option("--prefix", "", "Install prefix (required)",
daemon_opts.prefix_arg);
auto &daemon_target_cmd =
daemon_cmd.subcommand("target", "Target metadata served by the daemon");
auto &daemon_target_info_cmd = daemon_target_cmd.subcommand(