From: Michael Tremer Date: Fri, 18 Oct 2024 12:55:16 +0000 (+0000) Subject: cli: builder: Add command to update a snapshot X-Git-Tag: 0.9.30~1014 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a693bd2c214ef04516a4b039f31976b5c9c75b55;p=pakfire.git cli: builder: Add command to update a snapshot Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 11caea1d8..5f31c49fc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -526,6 +526,10 @@ libcli_la_SOURCES = \ src/cli/lib/shell.h \ src/cli/lib/search.c \ src/cli/lib/search.h \ + src/cli/lib/snapshot.c \ + src/cli/lib/snapshot.h \ + src/cli/lib/snapshot_update.c \ + src/cli/lib/snapshot_update.h \ src/cli/lib/sync.c \ src/cli/lib/sync.h \ src/cli/lib/terminal.c \ diff --git a/src/cli/lib/snapshot.c b/src/cli/lib/snapshot.c new file mode 100644 index 000000000..faacde726 --- /dev/null +++ b/src/cli/lib/snapshot.c @@ -0,0 +1,32 @@ +/*############################################################################# +# # +# Pakfire - The IPFire package management system # +# Copyright (C) 2024 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 . # +# # +#############################################################################*/ + +#include "command.h" +#include "snapshot.h" +#include "snapshot_update.h" + +int cli_snapshot(void* data, int argc, char* argv[]) { + static const struct command commands[] = { + { "update", cli_snapshot_update, 0, 0, 0 }, + { NULL }, + }; + + return cli_parse(NULL, commands, NULL, NULL, NULL, 0, argc, argv, data); +} diff --git a/src/cli/lib/snapshot.h b/src/cli/lib/snapshot.h new file mode 100644 index 000000000..49b26ff28 --- /dev/null +++ b/src/cli/lib/snapshot.h @@ -0,0 +1,26 @@ +/*############################################################################# +# # +# Pakfire - The IPFire package management system # +# Copyright (C) 2024 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 . # +# # +#############################################################################*/ + +#ifndef PAKFIRE_CLI_SNAPSHOT_H +#define PAKFIRE_CLI_SNAPSHOT_H + +int cli_snapshot(void* data, int argc, char* argv[]); + +#endif /* PAKFIRE_CLI_SNAPSHOT_H */ diff --git a/src/cli/pakfire-builder.c b/src/cli/pakfire-builder.c index d1e40e945..8887a28f4 100644 --- a/src/cli/pakfire-builder.c +++ b/src/cli/pakfire-builder.c @@ -45,6 +45,7 @@ #include "lib/requires.h" #include "lib/shell.h" #include "lib/search.h" +#include "lib/snapshot.h" #include "lib/terminal.h" #include "lib/version.h" @@ -80,6 +81,7 @@ static const struct command commands[] = { { "requires", cli_requires, 1, -1, 0 }, { "shell", cli_shell, 0, -1, 0 }, { "search", cli_search, 1, -1, 0 }, + { "snapshot", cli_snapshot, 1, -1, 0 }, { NULL }, }; @@ -93,7 +95,8 @@ const char* args_doc = "repolist\n" "requires PATTERN\n" "shell [OPTIONS...] [COMMAND...]\n" - "search [OPTIONS...] PATTERN"; + "search [OPTIONS...] PATTERN\n" + "snapshot [COMMAND...]"; static error_t parse(int key, char* arg, struct argp_state* state, void* data) { struct cli_config* config = data;