| @@ -1,22 +1,22 @@ | | | @@ -1,22 +1,22 @@ |
1 | /* $NetBSD: perform.c,v 1.117 2020/12/12 01:44:17 gutteridge Exp $ */ | | 1 | /* $NetBSD: perform.c,v 1.118 2020/12/12 04:12:47 gutteridge Exp $ */ |
2 | #if HAVE_CONFIG_H | | 2 | #if HAVE_CONFIG_H |
3 | #include "config.h" | | 3 | #include "config.h" |
4 | #endif | | 4 | #endif |
5 | #include <nbcompat.h> | | 5 | #include <nbcompat.h> |
6 | #if HAVE_SYS_CDEFS_H | | 6 | #if HAVE_SYS_CDEFS_H |
7 | #include <sys/cdefs.h> | | 7 | #include <sys/cdefs.h> |
8 | #endif | | 8 | #endif |
9 | __RCSID("$NetBSD: perform.c,v 1.117 2020/12/12 01:44:17 gutteridge Exp $"); | | 9 | __RCSID("$NetBSD: perform.c,v 1.118 2020/12/12 04:12:47 gutteridge Exp $"); |
10 | | | 10 | |
11 | /*- | | 11 | /*- |
12 | * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> | | 12 | * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> |
13 | * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org> | | 13 | * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org> |
14 | * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org> | | 14 | * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org> |
15 | * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org> | | 15 | * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org> |
16 | * Copyright (c) 2010 Thomas Klausner <wiz@NetBSD.org> | | 16 | * Copyright (c) 2010 Thomas Klausner <wiz@NetBSD.org> |
17 | * All rights reserved. | | 17 | * All rights reserved. |
18 | * | | 18 | * |
19 | * Redistribution and use in source and binary forms, with or without | | 19 | * Redistribution and use in source and binary forms, with or without |
20 | * modification, are permitted provided that the following conditions | | 20 | * modification, are permitted provided that the following conditions |
21 | * are met: | | 21 | * are met: |
22 | * | | 22 | * |
| @@ -1180,27 +1180,27 @@ check_dependencies(struct pkg_task *pkg) | | | @@ -1180,27 +1180,27 @@ check_dependencies(struct pkg_task *pkg) |
1180 | * Now that all dependencies have been processed we can find the best | | 1180 | * Now that all dependencies have been processed we can find the best |
1181 | * matches for pkg_register_depends() to store in our +REQUIRED_BY. | | 1181 | * matches for pkg_register_depends() to store in our +REQUIRED_BY. |
1182 | */ | | 1182 | */ |
1183 | for (p = pkg->plist.head; p != NULL; p = p->next) { | | 1183 | for (p = pkg->plist.head; p != NULL; p = p->next) { |
1184 | if (p->type == PLIST_IGNORE) { | | 1184 | if (p->type == PLIST_IGNORE) { |
1185 | p = p->next; | | 1185 | p = p->next; |
1186 | continue; | | 1186 | continue; |
1187 | } else if (p->type != PLIST_PKGDEP) | | 1187 | } else if (p->type != PLIST_PKGDEP) |
1188 | continue; | | 1188 | continue; |
1189 | | | 1189 | |
1190 | best_installed = find_best_matching_installed_pkg(p->name, 0); | | 1190 | best_installed = find_best_matching_installed_pkg(p->name, 0); |
1191 | if (best_installed == NULL) { | | 1191 | if (best_installed == NULL) { |
1192 | warnx("Expected dependency %s still missing", p->name); | | 1192 | warnx("Expected dependency %s still missing", p->name); |
1193 | return -1; | | 1193 | return -1; |
1194 | } | | 1194 | } |
1195 | | | 1195 | |
1196 | for (i = 0; i < pkg->dep_length; ++i) { | | 1196 | for (i = 0; i < pkg->dep_length; ++i) { |
1197 | if (strcmp(best_installed, pkg->dependencies[i]) == 0) | | 1197 | if (strcmp(best_installed, pkg->dependencies[i]) == 0) |
1198 | break; | | 1198 | break; |
1199 | } | | 1199 | } |
1200 | if (i < pkg->dep_length) { | | 1200 | if (i < pkg->dep_length) { |
1201 | /* Already used as dependency, so skip it. */ | | 1201 | /* Already used as dependency, so skip it. */ |
1202 | free(best_installed); | | 1202 | free(best_installed); |
1203 | continue; | | 1203 | continue; |
1204 | } | | 1204 | } |
1205 | if (pkg->dep_length + 1 >= pkg->dep_allocated) { | | 1205 | if (pkg->dep_length + 1 >= pkg->dep_allocated) { |
1206 | char **tmp; | | 1206 | char **tmp; |