]> git.ipfire.org Git - pakfire.git/commitdiff
cli: builder: Add command to update a snapshot
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Oct 2024 12:55:16 +0000 (12:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Oct 2024 12:55:16 +0000 (12:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/cli/lib/snapshot.c [new file with mode: 0644]
src/cli/lib/snapshot.h [new file with mode: 0644]
src/cli/pakfire-builder.c

index 11caea1d8f8758fdc8487e1e877ebd71927d394a..5f31c49fc959478e044c69bbf5e9cc720df9967e 100644 (file)
@@ -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 (file)
index 0000000..faacde7
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+#############################################################################*/
+
+#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 (file)
index 0000000..49b26ff
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+#############################################################################*/
+
+#ifndef PAKFIRE_CLI_SNAPSHOT_H
+#define PAKFIRE_CLI_SNAPSHOT_H
+
+int cli_snapshot(void* data, int argc, char* argv[]);
+
+#endif /* PAKFIRE_CLI_SNAPSHOT_H */
index d1e40e945a88c364d16a179912d5adb69fb278b5..8887a28f4026efc4ac4393b4b547b55922c3711f 100644 (file)
@@ -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;