| @@ -1,22 +1,22 @@ | | | @@ -1,22 +1,22 @@ |
1 | /* $NetBSD: perform.c,v 1.79 2009/02/26 12:52:43 joerg Exp $ */ | | 1 | /* $NetBSD: perform.c,v 1.80 2009/02/27 19:34:12 joerg 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.79 2009/02/26 12:52:43 joerg Exp $"); | | 9 | __RCSID("$NetBSD: perform.c,v 1.80 2009/02/27 19:34:12 joerg 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 | * All rights reserved. | | 16 | * All rights reserved. |
17 | * | | 17 | * |
18 | * Redistribution and use in source and binary forms, with or without | | 18 | * Redistribution and use in source and binary forms, with or without |
19 | * modification, are permitted provided that the following conditions | | 19 | * modification, are permitted provided that the following conditions |
20 | * are met: | | 20 | * are met: |
21 | * | | 21 | * |
22 | * 1. Redistributions of source code must retain the above copyright | | 22 | * 1. Redistributions of source code must retain the above copyright |
| @@ -891,27 +891,27 @@ run_install_script(struct pkg_task *pkg, | | | @@ -891,27 +891,27 @@ run_install_script(struct pkg_task *pkg, |
891 | } | | 891 | } |
892 | | | 892 | |
893 | struct find_conflict_data { | | 893 | struct find_conflict_data { |
894 | const char *pkg; | | 894 | const char *pkg; |
895 | const char *old_pkg; | | 895 | const char *old_pkg; |
896 | const char *pattern; | | 896 | const char *pattern; |
897 | }; | | 897 | }; |
898 | | | 898 | |
899 | static int | | 899 | static int |
900 | check_explicit_conflict_iter(const char *cur_pkg, void *cookie) | | 900 | check_explicit_conflict_iter(const char *cur_pkg, void *cookie) |
901 | { | | 901 | { |
902 | struct find_conflict_data *data = cookie; | | 902 | struct find_conflict_data *data = cookie; |
903 | | | 903 | |
904 | if (strcmp(data->old_pkg, cur_pkg) == 0) | | 904 | if (data->old_pkg && strcmp(data->old_pkg, cur_pkg) == 0) |
905 | return 0; | | 905 | return 0; |
906 | | | 906 | |
907 | warnx("Package `%s' conflicts with `%s', and `%s' is installed.", | | 907 | warnx("Package `%s' conflicts with `%s', and `%s' is installed.", |
908 | data->pkg, data->pattern, cur_pkg); | | 908 | data->pkg, data->pattern, cur_pkg); |
909 | | | 909 | |
910 | return 1; | | 910 | return 1; |
911 | } | | 911 | } |
912 | | | 912 | |
913 | static int | | 913 | static int |
914 | check_explicit_conflict(struct pkg_task *pkg) | | 914 | check_explicit_conflict(struct pkg_task *pkg) |
915 | { | | 915 | { |
916 | struct find_conflict_data data; | | 916 | struct find_conflict_data data; |
917 | char *installed, *installed_pattern; | | 917 | char *installed, *installed_pattern; |