| @@ -1,22 +1,22 @@ | | | @@ -1,22 +1,22 @@ |
1 | /* $NetBSD: perform.c,v 1.75 2009/02/03 19:47:37 joerg Exp $ */ | | 1 | /* $NetBSD: perform.c,v 1.76 2009/02/11 23:42:42 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.75 2009/02/03 19:47:37 joerg Exp $"); | | 9 | __RCSID("$NetBSD: perform.c,v 1.76 2009/02/11 23:42:42 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 |
| @@ -448,27 +448,27 @@ check_other_installed(struct pkg_task *p | | | @@ -448,27 +448,27 @@ check_other_installed(struct pkg_task *p |
448 | return status; | | 448 | return status; |
449 | } | | 449 | } |
450 | | | 450 | |
451 | /* | | 451 | /* |
452 | * Read package build information from meta data. | | 452 | * Read package build information from meta data. |
453 | */ | | 453 | */ |
454 | static int | | 454 | static int |
455 | read_buildinfo(struct pkg_task *pkg) | | 455 | read_buildinfo(struct pkg_task *pkg) |
456 | { | | 456 | { |
457 | const char *data, *eol, *next_line; | | 457 | const char *data, *eol, *next_line; |
458 | | | 458 | |
459 | data = pkg->meta_data.meta_build_info; | | 459 | data = pkg->meta_data.meta_build_info; |
460 | | | 460 | |
461 | for (; *data != '\0'; data = next_line) { | | 461 | for (; data != NULL && *data != '\0'; data = next_line) { |
462 | if ((eol = strchr(data, '\n')) == NULL) { | | 462 | if ((eol = strchr(data, '\n')) == NULL) { |
463 | eol = data + strlen(data); | | 463 | eol = data + strlen(data); |
464 | next_line = eol; | | 464 | next_line = eol; |
465 | } else | | 465 | } else |
466 | next_line = eol + 1; | | 466 | next_line = eol + 1; |
467 | | | 467 | |
468 | if (strncmp(data, "OPSYS=", 6) == 0) | | 468 | if (strncmp(data, "OPSYS=", 6) == 0) |
469 | pkg->buildinfo[BI_OPSYS] = dup_value(data, eol); | | 469 | pkg->buildinfo[BI_OPSYS] = dup_value(data, eol); |
470 | else if (strncmp(data, "OS_VERSION=", 11) == 0) | | 470 | else if (strncmp(data, "OS_VERSION=", 11) == 0) |
471 | pkg->buildinfo[BI_OS_VERSION] = dup_value(data, eol); | | 471 | pkg->buildinfo[BI_OS_VERSION] = dup_value(data, eol); |
472 | else if (strncmp(data, "MACHINE_ARCH=", 13) == 0) | | 472 | else if (strncmp(data, "MACHINE_ARCH=", 13) == 0) |
473 | pkg->buildinfo[BI_MACHINE_ARCH] = dup_value(data, eol); | | 473 | pkg->buildinfo[BI_MACHINE_ARCH] = dup_value(data, eol); |
474 | else if (strncmp(data, "IGNORE_RECOMMENDED=", 19) == 0) | | 474 | else if (strncmp(data, "IGNORE_RECOMMENDED=", 19) == 0) |