2019-02-03 11:43:15 +01:00
|
|
|
#ifndef INSTALL_H
|
|
|
|
#define INSTALL_H
|
|
|
|
|
2019-02-03 12:37:49 +01:00
|
|
|
#include <stdbool.h>
|
2019-02-03 11:43:15 +01:00
|
|
|
#include <getopt.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
2019-02-04 15:21:19 +01:00
|
|
|
#include "util/util.h"
|
|
|
|
|
2019-02-04 15:39:43 +01:00
|
|
|
#include "filelist/image_entry.h"
|
|
|
|
|
2019-02-03 11:43:15 +01:00
|
|
|
#include "pkgreader.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "pkgio.h"
|
|
|
|
|
2019-02-03 12:37:49 +01:00
|
|
|
enum {
|
|
|
|
INSTALL_MODE_INSTALL = 0,
|
|
|
|
INSTALL_MODE_LIST_PKG,
|
|
|
|
INSTALL_MODE_LIST_FILES,
|
|
|
|
};
|
|
|
|
|
2019-02-03 11:43:15 +01:00
|
|
|
struct pkg_dep_node {
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
/* num dependencies == number of outgoing edges */
|
|
|
|
size_t num_deps;
|
|
|
|
|
|
|
|
/* direct dependencies == array of outgoing edges */
|
|
|
|
struct pkg_dep_node **deps;
|
|
|
|
|
|
|
|
/* linked list pointer */
|
|
|
|
struct pkg_dep_node *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pkg_dep_list {
|
|
|
|
struct pkg_dep_node *head;
|
|
|
|
struct pkg_dep_node *tail;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pkg_dep_node *append_pkg(struct pkg_dep_list *list, const char *name);
|
|
|
|
|
|
|
|
struct pkg_dep_node *find_pkg(struct pkg_dep_list *list, const char *name);
|
|
|
|
|
|
|
|
void pkg_list_cleanup(struct pkg_dep_list *list);
|
|
|
|
|
|
|
|
int collect_dependencies(int repofd, struct pkg_dep_list *list);
|
|
|
|
|
|
|
|
int sort_by_dependencies(struct pkg_dep_list *list);
|
|
|
|
|
|
|
|
#endif /* INSTALL_H */
|