1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-06-19 18:40:14 +02:00

install: make sure package dependencies have no trivial cycles

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-02-21 15:11:09 +01:00
parent 98b655f133
commit 82c888bcbf

View file

@ -42,6 +42,13 @@ int collect_dependencies(int repofd, struct pkg_dep_list *list)
buffer[dep.name_length] = '\0';
if (strcmp((char *)buffer, it->name) == 0) {
fprintf(stderr,
"%s: package depends on itself\n",
it->name);
goto fail;
}
it->deps[i] = find_pkg(list, (char *)buffer);
if (it->deps[i] == NULL) {
it->deps[i] = append_pkg(list, (char *)buffer);