From: Michael Tremer Date: Thu, 28 Sep 2023 10:41:28 +0000 (+0000) Subject: cli: Move any kind of actions into the library so we can re-use them X-Git-Tag: 0.9.30~1621 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d203274113680b0b925032571cc780ec970acbc3;p=pakfire.git cli: Move any kind of actions into the library so we can re-use them Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 345cc3de1..16a32fc64 100644 --- a/Makefile.am +++ b/Makefile.am @@ -385,31 +385,7 @@ bin_PROGRAMS += \ pakfire pakfire_SOURCES = \ - src/cli/pakfire/main.c \ - src/cli/pakfire/check.c \ - src/cli/pakfire/check.h \ - src/cli/pakfire/clean.c \ - src/cli/pakfire/clean.h \ - src/cli/pakfire/info.c \ - src/cli/pakfire/info.h \ - src/cli/pakfire/install.h \ - src/cli/pakfire/install.c \ - src/cli/pakfire/provides.h \ - src/cli/pakfire/provides.c \ - src/cli/pakfire/remove.c \ - src/cli/pakfire/remove.h \ - src/cli/pakfire/repolist.c \ - src/cli/pakfire/repolist.h \ - src/cli/pakfire/requires.c \ - src/cli/pakfire/requires.h \ - src/cli/pakfire/search.c \ - src/cli/pakfire/search.h \ - src/cli/pakfire/sync.c \ - src/cli/pakfire/sync.h \ - src/cli/pakfire/transaction.c \ - src/cli/pakfire/transaction.h \ - src/cli/pakfire/update.c \ - src/cli/pakfire/update.h + src/cli/pakfire/main.c pakfire_CPPFLAGS = \ $(AM_CPPFLAGS) \ @@ -453,12 +429,36 @@ noinst_LTLIBRARIES += \ libcli.la libcli_la_SOURCES = \ + src/cli/lib/check.c \ + src/cli/lib/check.h \ + src/cli/lib/clean.c \ + src/cli/lib/clean.h \ src/cli/lib/command.c \ src/cli/lib/command.h \ src/cli/lib/dump.c \ src/cli/lib/dump.h \ + src/cli/lib/info.c \ + src/cli/lib/info.h \ + src/cli/lib/install.h \ + src/cli/lib/install.c \ + src/cli/lib/provides.h \ + src/cli/lib/provides.c \ + src/cli/lib/remove.c \ + src/cli/lib/remove.h \ + src/cli/lib/repolist.c \ + src/cli/lib/repolist.h \ + src/cli/lib/requires.c \ + src/cli/lib/requires.h \ + src/cli/lib/search.c \ + src/cli/lib/search.h \ + src/cli/lib/sync.c \ + src/cli/lib/sync.h \ src/cli/lib/terminal.c \ src/cli/lib/terminal.h \ + src/cli/lib/transaction.c \ + src/cli/lib/transaction.h \ + src/cli/lib/update.c \ + src/cli/lib/update.h \ src/cli/lib/version.c \ src/cli/lib/version.h diff --git a/src/cli/pakfire/check.c b/src/cli/lib/check.c similarity index 100% rename from src/cli/pakfire/check.c rename to src/cli/lib/check.c diff --git a/src/cli/pakfire/check.h b/src/cli/lib/check.h similarity index 100% rename from src/cli/pakfire/check.h rename to src/cli/lib/check.h diff --git a/src/cli/pakfire/clean.c b/src/cli/lib/clean.c similarity index 100% rename from src/cli/pakfire/clean.c rename to src/cli/lib/clean.c diff --git a/src/cli/pakfire/clean.h b/src/cli/lib/clean.h similarity index 100% rename from src/cli/pakfire/clean.h rename to src/cli/lib/clean.h diff --git a/src/cli/pakfire/info.c b/src/cli/lib/info.c similarity index 100% rename from src/cli/pakfire/info.c rename to src/cli/lib/info.c diff --git a/src/cli/pakfire/info.h b/src/cli/lib/info.h similarity index 100% rename from src/cli/pakfire/info.h rename to src/cli/lib/info.h diff --git a/src/cli/pakfire/install.c b/src/cli/lib/install.c similarity index 100% rename from src/cli/pakfire/install.c rename to src/cli/lib/install.c diff --git a/src/cli/pakfire/install.h b/src/cli/lib/install.h similarity index 100% rename from src/cli/pakfire/install.h rename to src/cli/lib/install.h diff --git a/src/cli/pakfire/provides.c b/src/cli/lib/provides.c similarity index 100% rename from src/cli/pakfire/provides.c rename to src/cli/lib/provides.c diff --git a/src/cli/pakfire/provides.h b/src/cli/lib/provides.h similarity index 100% rename from src/cli/pakfire/provides.h rename to src/cli/lib/provides.h diff --git a/src/cli/pakfire/remove.c b/src/cli/lib/remove.c similarity index 100% rename from src/cli/pakfire/remove.c rename to src/cli/lib/remove.c diff --git a/src/cli/pakfire/remove.h b/src/cli/lib/remove.h similarity index 100% rename from src/cli/pakfire/remove.h rename to src/cli/lib/remove.h diff --git a/src/cli/pakfire/repolist.c b/src/cli/lib/repolist.c similarity index 100% rename from src/cli/pakfire/repolist.c rename to src/cli/lib/repolist.c diff --git a/src/cli/pakfire/repolist.h b/src/cli/lib/repolist.h similarity index 100% rename from src/cli/pakfire/repolist.h rename to src/cli/lib/repolist.h diff --git a/src/cli/pakfire/requires.c b/src/cli/lib/requires.c similarity index 100% rename from src/cli/pakfire/requires.c rename to src/cli/lib/requires.c diff --git a/src/cli/pakfire/requires.h b/src/cli/lib/requires.h similarity index 100% rename from src/cli/pakfire/requires.h rename to src/cli/lib/requires.h diff --git a/src/cli/pakfire/search.c b/src/cli/lib/search.c similarity index 100% rename from src/cli/pakfire/search.c rename to src/cli/lib/search.c diff --git a/src/cli/pakfire/search.h b/src/cli/lib/search.h similarity index 100% rename from src/cli/pakfire/search.h rename to src/cli/lib/search.h diff --git a/src/cli/pakfire/sync.c b/src/cli/lib/sync.c similarity index 100% rename from src/cli/pakfire/sync.c rename to src/cli/lib/sync.c diff --git a/src/cli/pakfire/sync.h b/src/cli/lib/sync.h similarity index 100% rename from src/cli/pakfire/sync.h rename to src/cli/lib/sync.h diff --git a/src/cli/pakfire/transaction.c b/src/cli/lib/transaction.c similarity index 100% rename from src/cli/pakfire/transaction.c rename to src/cli/lib/transaction.c diff --git a/src/cli/pakfire/transaction.h b/src/cli/lib/transaction.h similarity index 100% rename from src/cli/pakfire/transaction.h rename to src/cli/lib/transaction.h diff --git a/src/cli/pakfire/update.c b/src/cli/lib/update.c similarity index 100% rename from src/cli/pakfire/update.c rename to src/cli/lib/update.c diff --git a/src/cli/pakfire/update.h b/src/cli/lib/update.h similarity index 100% rename from src/cli/pakfire/update.h rename to src/cli/lib/update.h diff --git a/src/cli/pakfire/main.c b/src/cli/pakfire/main.c index eee3e0a56..53ac6acdd 100644 --- a/src/cli/pakfire/main.c +++ b/src/cli/pakfire/main.c @@ -26,21 +26,20 @@ #include +#include "../lib/clean.h" #include "../lib/command.h" +#include "../lib/info.h" +#include "../lib/install.h" +#include "../lib/provides.h" +#include "../lib/remove.h" +#include "../lib/repolist.h" +#include "../lib/requires.h" +#include "../lib/search.h" +#include "../lib/sync.h" #include "../lib/terminal.h" +#include "../lib/update.h" #include "../lib/version.h" -#include "clean.h" -#include "info.h" -#include "install.h" -#include "provides.h" -#include "remove.h" -#include "repolist.h" -#include "requires.h" -#include "search.h" -#include "sync.h" -#include "update.h" - #define MAX_REPOS 16 struct config {