From 4a7b1d3b3c01284b3255ef13abffd111a392f199 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 17 Jul 2019 12:45:23 +0200 Subject: [PATCH] cleanup: move package dependency management to libpkg.a Signed-off-by: David Oberhollenzer --- main/depgraph.h => include/pkg/pkglist.h | 6 +++--- lib/Makemodule.am | 2 ++ {main/depgraph => lib/pkg}/collect.c | 2 +- {main/depgraph => lib/pkg}/pkglist.c | 2 +- {main/depgraph => lib/pkg}/tsort.c | 2 +- main/Makemodule.am | 5 +---- main/cmd/depgraph.c | 2 +- main/cmd/install.c | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) rename main/depgraph.h => include/pkg/pkglist.h (91%) rename {main/depgraph => lib/pkg}/collect.c (98%) rename {main/depgraph => lib/pkg}/pkglist.c (97%) rename {main/depgraph => lib/pkg}/tsort.c (98%) diff --git a/main/depgraph.h b/include/pkg/pkglist.h similarity index 91% rename from main/depgraph.h rename to include/pkg/pkglist.h index 7a2d1c8..d6455c8 100644 --- a/main/depgraph.h +++ b/include/pkg/pkglist.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: ISC */ -#ifndef DEPGRAPH_H -#define DEPGRAPH_H +#ifndef PKGLIST_H +#define PKGLIST_H struct pkg_dep_node { char *name; @@ -30,4 +30,4 @@ int collect_dependencies(int repofd, struct pkg_dep_list *list); int sort_by_dependencies(struct pkg_dep_list *list); -#endif /* DEPGRAPH_H */ +#endif /* PKGLIST_H */ diff --git a/lib/Makemodule.am b/lib/Makemodule.am index 9fa19f6..b843833 100644 --- a/lib/Makemodule.am +++ b/lib/Makemodule.am @@ -30,7 +30,9 @@ endif libpkg_a_SOURCES = include/pkg/pkgformat.h include/pkg/pkgreader.h libpkg_a_SOURCES += include/pkg/pkgio.h include/pkg/pkgwriter.h +libpkg_a_SOURCES += include/pkg/pkglist.h libpkg_a_SOURCES += lib/pkg/pkgreader.c lib/pkg/pkgwriter.c libpkg_a_SOURCES += lib/pkg/pkg_unpack.c lib/pkg/pkgio_rd_image_entry.c +libpkg_a_SOURCES += lib/pkg/collect.c lib/pkg/pkglist.c lib/pkg/tsort.c noinst_LIBRARIES += libutil.a libfilelist.a libcomp.a libpkg.a diff --git a/main/depgraph/collect.c b/lib/pkg/collect.c similarity index 98% rename from main/depgraph/collect.c rename to lib/pkg/collect.c index 2c9275a..9571e04 100644 --- a/main/depgraph/collect.c +++ b/lib/pkg/collect.c @@ -4,7 +4,7 @@ #include #include "pkg/pkgreader.h" -#include "depgraph.h" +#include "pkg/pkglist.h" int collect_dependencies(int repofd, struct pkg_dep_list *list) { diff --git a/main/depgraph/pkglist.c b/lib/pkg/pkglist.c similarity index 97% rename from main/depgraph/pkglist.c rename to lib/pkg/pkglist.c index 71c7823..0f4cda2 100644 --- a/main/depgraph/pkglist.c +++ b/lib/pkg/pkglist.c @@ -3,7 +3,7 @@ #include #include -#include "depgraph.h" +#include "pkg/pkglist.h" struct pkg_dep_node *append_pkg(struct pkg_dep_list *list, const char *name) { diff --git a/main/depgraph/tsort.c b/lib/pkg/tsort.c similarity index 98% rename from main/depgraph/tsort.c rename to lib/pkg/tsort.c index 0c8d428..f81aec1 100644 --- a/main/depgraph/tsort.c +++ b/lib/pkg/tsort.c @@ -2,7 +2,7 @@ #include #include -#include "depgraph.h" +#include "pkg/pkglist.h" static void remove_dependency(struct pkg_dep_list *list, struct pkg_dep_node *pkg) diff --git a/main/Makemodule.am b/main/Makemodule.am index 443f698..e2e7a33 100644 --- a/main/Makemodule.am +++ b/main/Makemodule.am @@ -1,7 +1,4 @@ -pkg_SOURCES = main/command.h main/depgraph.h -pkg_SOURCES += main/pkg.c main/command.c -pkg_SOURCES += main/depgraph/collect.c main/depgraph/pkglist.c -pkg_SOURCES += main/depgraph/tsort.c +pkg_SOURCES = main/command.h main/pkg.c main/command.c pkg_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/main pkg_CFLAGS = $(AM_CFLAGS) diff --git a/main/cmd/depgraph.c b/main/cmd/depgraph.c index 5a49253..43cf311 100644 --- a/main/cmd/depgraph.c +++ b/main/cmd/depgraph.c @@ -7,7 +7,7 @@ #include #include -#include "depgraph.h" +#include "pkg/pkglist.h" #include "command.h" #include "config.h" diff --git a/main/cmd/install.c b/main/cmd/install.c index 847b6b2..9b55648 100644 --- a/main/cmd/install.c +++ b/main/cmd/install.c @@ -7,9 +7,9 @@ #include #include +#include "pkg/pkglist.h" #include "pkg/pkgio.h" #include "util/util.h" -#include "depgraph.h" #include "command.h" #include "config.h"