Module Name: src Committed By: snj Date: Thu Feb 4 06:45:59 UTC 2010
Modified Files: src/external/bsd/pkg_install/dist/add [netbsd-5]: perform.c src/external/bsd/pkg_install/dist/bpm [netbsd-5]: bpm.1 bpm.sh.in src/external/bsd/pkg_install/dist/delete [netbsd-5]: pkg_delete.c src/external/bsd/pkg_install/dist/lib [netbsd-5]: defs.h lib.h version.c version.h Log Message: Apply patch (requested by joerg in ticket #1298): Update pkg_install to 20100204. - Restore PKG_PREFIX in pkg_delete (PR 42731) - Ensure that the current pkg_install version is at least as new as the version used to build the package To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.6.3 -r1.1.1.1.6.4 \ src/external/bsd/pkg_install/dist/add/perform.c cvs rdiff -u -r1.1.1.1.6.2 -r1.1.1.1.6.3 \ src/external/bsd/pkg_install/dist/bpm/bpm.1 cvs rdiff -u -r1.1.1.1 -r1.1.1.1.6.1 \ src/external/bsd/pkg_install/dist/bpm/bpm.sh.in cvs rdiff -u -r1.1.1.4.6.4 -r1.1.1.4.6.5 \ src/external/bsd/pkg_install/dist/delete/pkg_delete.c cvs rdiff -u -r1.1.1.1 -r1.1.1.1.6.1 \ src/external/bsd/pkg_install/dist/lib/defs.h cvs rdiff -u -r1.1.1.1.6.3 -r1.1.1.1.6.4 \ src/external/bsd/pkg_install/dist/lib/lib.h cvs rdiff -u -r1.1.1.1.6.2 -r1.1.1.1.6.3 \ src/external/bsd/pkg_install/dist/lib/version.c cvs rdiff -u -r1.1.1.2.6.5 -r1.1.1.2.6.6 \ src/external/bsd/pkg_install/dist/lib/version.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/pkg_install/dist/add/perform.c diff -u src/external/bsd/pkg_install/dist/add/perform.c:1.1.1.1.6.3 src/external/bsd/pkg_install/dist/add/perform.c:1.1.1.1.6.4 --- src/external/bsd/pkg_install/dist/add/perform.c:1.1.1.1.6.3 Wed Feb 3 00:38:21 2010 +++ src/external/bsd/pkg_install/dist/add/perform.c Thu Feb 4 06:45:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.1.1.1.6.3 2010/02/03 00:38:21 snj Exp $ */ +/* $NetBSD: perform.c,v 1.1.1.1.6.4 2010/02/04 06:45:58 snj Exp $ */ #if HAVE_CONFIG_H #include "config.h" #endif @@ -6,7 +6,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: perform.c,v 1.1.1.1.6.3 2010/02/03 00:38:21 snj Exp $"); +__RCSID("$NetBSD: perform.c,v 1.1.1.1.6.4 2010/02/04 06:45:58 snj Exp $"); /*- * Copyright (c) 2003 Grant Beattie <gr...@netbsd.org> @@ -57,6 +57,7 @@ #include "lib.h" #include "add.h" +#include "version.h" struct pkg_meta { char *meta_contents; @@ -500,6 +501,9 @@ eol); else if (strncmp(data, "LICENSE=", 8) == 0) pkg->buildinfo[BI_LICENSE] = dup_value(data, eol); + else if (strncmp(data, "PKGTOOLS_VERSION=", 17) == 0) + pkg->buildinfo[BI_PKGTOOLS_VERSION] = dup_value(data, + eol); } if (pkg->buildinfo[BI_OPSYS] == NULL || pkg->buildinfo[BI_OS_VERSION] == NULL || @@ -879,6 +883,32 @@ return 0; } +static int +check_pkgtools_version(struct pkg_task *pkg) +{ + const char *val = pkg->buildinfo[BI_PKGTOOLS_VERSION]; + int version; + + if (val == NULL) { + warnx("Warning: package `%s' lacks pkg_install version data", + pkg->pkgname); + return 0; + } + + if (strlen(val) != 8 || strspn(val, "0123456789") != 8) { + warnx("Warning: package `%s' contains an invalid pkg_install version", + pkg->pkgname); + return Force ? 0 : -1; + } + version = atoi(val); + if (version > PKGTOOLS_VERSION) { + warnx("%s: package `%s' was built with a newer pkg_install version", + Force ? "Warning" : "Error", pkg->pkgname); + return Force ? 0 : -1; + } + return 0; +} + /* * Run the install script. */ @@ -1336,6 +1366,9 @@ if (read_buildinfo(pkg)) goto clean_memory; + if (check_pkgtools_version(pkg)) + goto clean_memory; + if (check_vulnerable(pkg)) goto clean_memory; Index: src/external/bsd/pkg_install/dist/bpm/bpm.1 diff -u src/external/bsd/pkg_install/dist/bpm/bpm.1:1.1.1.1.6.2 src/external/bsd/pkg_install/dist/bpm/bpm.1:1.1.1.1.6.3 --- src/external/bsd/pkg_install/dist/bpm/bpm.1:1.1.1.1.6.2 Wed Feb 3 00:38:21 2010 +++ src/external/bsd/pkg_install/dist/bpm/bpm.1 Thu Feb 4 06:45:58 2010 @@ -1,7 +1,10 @@ -.\" $NetBSD: bpm.1,v 1.1.1.1.6.2 2010/02/03 00:38:21 snj Exp $ */ +.\" $NetBSD: bpm.1,v 1.1.1.1.6.3 2010/02/04 06:45:58 snj Exp $ */ .\" +.\" Copyright (c) 2003,2009 The NetBSD Foundation, Inc. +.\" All rights reserved. .\" -.\" Copyright (c) 2003 Alistair G. Crooks. All rights reserved. +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Alistair Crooks (a...@netbsd.org) .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -11,24 +14,18 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Alistair G. Crooks. -.\" 4. The name of the author may not be used to endorse or promote -.\" products derived from this software without specific prior written -.\" permission. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd August 3, 2007 .Dt BPM 1 Index: src/external/bsd/pkg_install/dist/bpm/bpm.sh.in diff -u src/external/bsd/pkg_install/dist/bpm/bpm.sh.in:1.1.1.1 src/external/bsd/pkg_install/dist/bpm/bpm.sh.in:1.1.1.1.6.1 --- src/external/bsd/pkg_install/dist/bpm/bpm.sh.in:1.1.1.1 Tue Sep 30 19:00:26 2008 +++ src/external/bsd/pkg_install/dist/bpm/bpm.sh.in Thu Feb 4 06:45:58 2010 @@ -1,8 +1,12 @@ #! /bin/sh # -# $NetBSD: bpm.sh.in,v 1.1.1.1 2008/09/30 19:00:26 joerg Exp $ +# $NetBSD: bpm.sh.in,v 1.1.1.1.6.1 2010/02/04 06:45:58 snj Exp $ # -# Copyright (c) 2003 Alistair G. Crooks. All rights reserved. +# Copyright (c) 2003,2009 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Alistair Crooks (a...@netbsd.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -12,24 +16,18 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by Alistair G. Crooks. -# 4. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. # -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. # die() Index: src/external/bsd/pkg_install/dist/delete/pkg_delete.c diff -u src/external/bsd/pkg_install/dist/delete/pkg_delete.c:1.1.1.4.6.4 src/external/bsd/pkg_install/dist/delete/pkg_delete.c:1.1.1.4.6.5 --- src/external/bsd/pkg_install/dist/delete/pkg_delete.c:1.1.1.4.6.4 Wed Feb 3 00:38:21 2010 +++ src/external/bsd/pkg_install/dist/delete/pkg_delete.c Thu Feb 4 06:45:58 2010 @@ -34,7 +34,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: pkg_delete.c,v 1.1.1.4.6.4 2010/02/03 00:38:21 snj Exp $"); +__RCSID("$NetBSD: pkg_delete.c,v 1.1.1.4.6.5 2010/02/04 06:45:58 snj Exp $"); #if HAVE_ERR_H #include <err.h> @@ -683,6 +683,7 @@ fname = pkgdb_pkg_dir(pkg); setenv(PKG_METADATA_DIR_VNAME, fname, 1); free(fname); + setenv(PKG_PREFIX_VNAME, p->name, 1); if (!no_deinstall && !unregister_only) { if (run_deinstall_script(pkg, 0) && !Force) Index: src/external/bsd/pkg_install/dist/lib/defs.h diff -u src/external/bsd/pkg_install/dist/lib/defs.h:1.1.1.1 src/external/bsd/pkg_install/dist/lib/defs.h:1.1.1.1.6.1 --- src/external/bsd/pkg_install/dist/lib/defs.h:1.1.1.1 Tue Sep 30 19:00:26 2008 +++ src/external/bsd/pkg_install/dist/lib/defs.h Thu Feb 4 06:45:58 2010 @@ -1,7 +1,11 @@ -/* $NetBSD: defs.h,v 1.1.1.1 2008/09/30 19:00:26 joerg Exp $ */ +/* $NetBSD: defs.h,v 1.1.1.1.6.1 2010/02/04 06:45:58 snj Exp $ */ -/* - * Copyright (c) 1999-2000 Alistair G. Crooks. All rights reserved. +/*- + * Copyright (c) 1999,2000,2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Alistair Crooks (a...@netbsd.org) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,24 +15,18 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Alistair G. Crooks. - * 4. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifndef DEFS_H_ #define DEFS_H_ Index: src/external/bsd/pkg_install/dist/lib/lib.h diff -u src/external/bsd/pkg_install/dist/lib/lib.h:1.1.1.1.6.3 src/external/bsd/pkg_install/dist/lib/lib.h:1.1.1.1.6.4 --- src/external/bsd/pkg_install/dist/lib/lib.h:1.1.1.1.6.3 Wed Feb 3 00:38:22 2010 +++ src/external/bsd/pkg_install/dist/lib/lib.h Thu Feb 4 06:45:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: lib.h,v 1.1.1.1.6.3 2010/02/03 00:38:22 snj Exp $ */ +/* $NetBSD: lib.h,v 1.1.1.1.6.4 2010/02/04 06:45:58 snj Exp $ */ /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */ @@ -184,7 +184,8 @@ BI_IGNORE_RECOMMENDED, /* 3 */ BI_USE_ABI_DEPENDS, /* 4 */ BI_LICENSE, /* 5 */ - BI_ENUM_COUNT /* 6 */ + BI_PKGTOOLS_VERSION, /* 6 */ + BI_ENUM_COUNT /* 7 */ } bi_ent_t; /* Types */ Index: src/external/bsd/pkg_install/dist/lib/version.c diff -u src/external/bsd/pkg_install/dist/lib/version.c:1.1.1.1.6.2 src/external/bsd/pkg_install/dist/lib/version.c:1.1.1.1.6.3 --- src/external/bsd/pkg_install/dist/lib/version.c:1.1.1.1.6.2 Wed Feb 3 00:38:23 2010 +++ src/external/bsd/pkg_install/dist/lib/version.c Thu Feb 4 06:45:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: version.c,v 1.1.1.1.6.2 2010/02/03 00:38:23 snj Exp $ */ +/* $NetBSD: version.c,v 1.1.1.1.6.3 2010/02/04 06:45:58 snj Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: version.c,v 1.1.1.1.6.2 2010/02/03 00:38:23 snj Exp $"); +__RCSID("$NetBSD: version.c,v 1.1.1.1.6.3 2010/02/04 06:45:58 snj Exp $"); /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -43,7 +43,7 @@ void show_version(void) { - printf("%s\n", PKGTOOLS_VERSION); + printf("%d\n", PKGTOOLS_VERSION); exit (0); } Index: src/external/bsd/pkg_install/dist/lib/version.h diff -u src/external/bsd/pkg_install/dist/lib/version.h:1.1.1.2.6.5 src/external/bsd/pkg_install/dist/lib/version.h:1.1.1.2.6.6 --- src/external/bsd/pkg_install/dist/lib/version.h:1.1.1.2.6.5 Wed Feb 3 00:38:23 2010 +++ src/external/bsd/pkg_install/dist/lib/version.h Thu Feb 4 06:45:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.1.1.2.6.5 2010/02/03 00:38:23 snj Exp $ */ +/* $NetBSD: version.h,v 1.1.1.2.6.6 2010/02/04 06:45:58 snj Exp $ */ /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -27,6 +27,6 @@ #ifndef _INST_LIB_VERSION_H_ #define _INST_LIB_VERSION_H_ -#define PKGTOOLS_VERSION "20100130" +#define PKGTOOLS_VERSION 20100204 #endif /* _INST_LIB_VERSION_H_ */