diff --git a/main/cmd/install/install.h b/include/depgraph.h similarity index 62% rename from main/cmd/install/install.h rename to include/depgraph.h index d27145c..7a2d1c8 100644 --- a/main/cmd/install/install.h +++ b/include/depgraph.h @@ -1,28 +1,6 @@ /* SPDX-License-Identifier: ISC */ -#ifndef INSTALL_H -#define INSTALL_H - -#include -#include -#include -#include -#include -#include -#include - -#include "util/util.h" - -#include "filelist/image_entry.h" - -#include "pkgreader.h" -#include "command.h" -#include "pkgio.h" - -enum { - INSTALL_MODE_INSTALL = 0, - INSTALL_MODE_LIST_PKG, - INSTALL_MODE_LIST_FILES, -}; +#ifndef DEPGRAPH_H +#define DEPGRAPH_H struct pkg_dep_node { char *name; @@ -52,4 +30,4 @@ int collect_dependencies(int repofd, struct pkg_dep_list *list); int sort_by_dependencies(struct pkg_dep_list *list); -#endif /* INSTALL_H */ +#endif /* DEPGRAPH_H */ diff --git a/main/Makemodule.am b/main/Makemodule.am index be62c48..ca4f149 100644 --- a/main/Makemodule.am +++ b/main/Makemodule.am @@ -1,7 +1,11 @@ pkg_SOURCES = include/pkgformat.h include/pkgreader.h include/pkgio.h pkg_SOURCES += include/compressor.h include/command.h include/pkgwriter.h +pkg_SOURCES += include/depgraph.h pkg_SOURCES += main/pkg.c main/compressor.c main/command.c main/pkgreader.c pkg_SOURCES += main/pkgwriter.c main/pkgio_rd_image_entry.c main/pkg_unpack.c +pkg_SOURCES += main/depgraph/collect.c main/depgraph/pkglist.c +pkg_SOURCES += main/depgraph/tsort.c + pkg_CFLAGS = $(AM_CFLAGS) pkg_LDADD = libutil.a libfilelist.a @@ -18,9 +22,7 @@ pkg_SOURCES += main/cmd/dump/dump.c main/cmd/dump/dump.h pkg_SOURCES += main/cmd/dump/dump_header.c # install command -pkg_SOURCES += main/cmd/install/collect.c main/cmd/install/install.c -pkg_SOURCES += main/cmd/install/install.h main/cmd/install/pkglist.c -pkg_SOURCES += main/cmd/install/tsort.c +pkg_SOURCES += main/cmd/install.c # buildstrategy command pkg_SOURCES += main/cmd/buildstrategy/buildstrategy.h diff --git a/main/cmd/install/install.c b/main/cmd/install.c similarity index 95% rename from main/cmd/install/install.c rename to main/cmd/install.c index 39f34b7..23ab976 100644 --- a/main/cmd/install/install.c +++ b/main/cmd/install.c @@ -1,5 +1,22 @@ /* SPDX-License-Identifier: ISC */ -#include "install.h" +#include +#include +#include +#include +#include +#include +#include + +#include "util/util.h" +#include "depgraph.h" +#include "command.h" +#include "pkgio.h" + +enum { + INSTALL_MODE_INSTALL = 0, + INSTALL_MODE_LIST_PKG, + INSTALL_MODE_LIST_FILES, +}; static const struct option long_opts[] = { { "root", required_argument, NULL, 'r' }, diff --git a/main/cmd/install/collect.c b/main/depgraph/collect.c similarity index 93% rename from main/cmd/install/collect.c rename to main/depgraph/collect.c index 2570976..60a0a47 100644 --- a/main/cmd/install/collect.c +++ b/main/depgraph/collect.c @@ -1,5 +1,10 @@ /* SPDX-License-Identifier: ISC */ -#include "install.h" +#include +#include +#include + +#include "pkgreader.h" +#include "depgraph.h" int collect_dependencies(int repofd, struct pkg_dep_list *list) { diff --git a/main/cmd/install/pkglist.c b/main/depgraph/pkglist.c similarity index 91% rename from main/cmd/install/pkglist.c rename to main/depgraph/pkglist.c index 78f9726..71c7823 100644 --- a/main/cmd/install/pkglist.c +++ b/main/depgraph/pkglist.c @@ -1,5 +1,9 @@ /* SPDX-License-Identifier: ISC */ -#include "install.h" +#include +#include +#include + +#include "depgraph.h" struct pkg_dep_node *append_pkg(struct pkg_dep_list *list, const char *name) { diff --git a/main/cmd/install/tsort.c b/main/depgraph/tsort.c similarity index 95% rename from main/cmd/install/tsort.c rename to main/depgraph/tsort.c index 599c21b..0c8d428 100644 --- a/main/cmd/install/tsort.c +++ b/main/depgraph/tsort.c @@ -1,5 +1,8 @@ /* SPDX-License-Identifier: ISC */ -#include "install.h" +#include +#include + +#include "depgraph.h" static void remove_dependency(struct pkg_dep_list *list, struct pkg_dep_node *pkg)