Browse Source

cleanup: move package dependency management to libpkg.a

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
master
David Oberhollenzer 3 years ago
parent
commit
4a7b1d3b3c
  1. 6
      include/pkg/pkglist.h
  2. 2
      lib/Makemodule.am
  3. 2
      lib/pkg/collect.c
  4. 2
      lib/pkg/pkglist.c
  5. 2
      lib/pkg/tsort.c
  6. 5
      main/Makemodule.am
  7. 2
      main/cmd/depgraph.c
  8. 2
      main/cmd/install.c

6
main/depgraph.h → 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 */

2
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

2
main/depgraph/collect.c → lib/pkg/collect.c

@ -4,7 +4,7 @@
#include <stdio.h>
#include "pkg/pkgreader.h"
#include "depgraph.h"
#include "pkg/pkglist.h"
int collect_dependencies(int repofd, struct pkg_dep_list *list)
{

2
main/depgraph/pkglist.c → lib/pkg/pkglist.c

@ -3,7 +3,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "depgraph.h"
#include "pkg/pkglist.h"
struct pkg_dep_node *append_pkg(struct pkg_dep_list *list, const char *name)
{

2
main/depgraph/tsort.c → lib/pkg/tsort.c

@ -2,7 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "depgraph.h"
#include "pkg/pkglist.h"
static void remove_dependency(struct pkg_dep_list *list,
struct pkg_dep_node *pkg)

5
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)

2
main/cmd/depgraph.c

@ -7,7 +7,7 @@
#include <stdio.h>
#include <fcntl.h>
#include "depgraph.h"
#include "pkg/pkglist.h"
#include "command.h"
#include "config.h"

2
main/cmd/install.c

@ -7,9 +7,9 @@
#include <stdio.h>
#include <fcntl.h>
#include "pkg/pkglist.h"
#include "pkg/pkgio.h"
#include "util/util.h"
#include "depgraph.h"
#include "command.h"
#include "config.h"

Loading…
Cancel
Save