Module Name: src Committed By: bouyer Date: Sun Jun 21 11:42:20 UTC 2009
Modified Files: src/external/bsd/pkg_install/dist/admin [netbsd-5-0]: pkg_admin.1 src/external/bsd/pkg_install/dist/lib [netbsd-5-0]: license.c version.h Log Message: Pullup the following revisions (requested by joerg in ticket 815): external/bsd/pkg_install/dist/admin/pkg_admin.1: 1.1.1.7 external/bsd/pkg_install/dist/lib/license.c: 1.1.1.3 external/bsd/pkg_install/dist/lib/version.h: 1.1.1.16 Merge pkg_install-20090610 from HEAD To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.8.1 -r1.1.1.1.8.2 \ src/external/bsd/pkg_install/dist/admin/pkg_admin.1 cvs rdiff -u -r1.1.1.2.2.2 -r1.1.1.2.2.3 \ src/external/bsd/pkg_install/dist/lib/license.c cvs rdiff -u -r1.1.1.2.8.1 -r1.1.1.2.8.2 \ 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/admin/pkg_admin.1 diff -u src/external/bsd/pkg_install/dist/admin/pkg_admin.1:1.1.1.1.8.1 src/external/bsd/pkg_install/dist/admin/pkg_admin.1:1.1.1.1.8.2 --- src/external/bsd/pkg_install/dist/admin/pkg_admin.1:1.1.1.1.8.1 Sat May 30 16:21:36 2009 +++ src/external/bsd/pkg_install/dist/admin/pkg_admin.1 Sun Jun 21 11:42:19 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_admin.1,v 1.1.1.1.8.1 2009/05/30 16:21:36 snj Exp $ +.\" $NetBSD: pkg_admin.1,v 1.1.1.1.8.2 2009/06/21 11:42:19 bouyer Exp $ .\" .\" Copyright (c) 1999-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -176,7 +176,7 @@ Reports if .Ar file is a correctly signed package. -.It Cm check-single-license Ar liccense +.It Cm check-single-license Ar license Check if .Ar license is a valid license name and if it is in the set of acceptable licenses. Index: src/external/bsd/pkg_install/dist/lib/license.c diff -u src/external/bsd/pkg_install/dist/lib/license.c:1.1.1.2.2.2 src/external/bsd/pkg_install/dist/lib/license.c:1.1.1.2.2.3 --- src/external/bsd/pkg_install/dist/lib/license.c:1.1.1.2.2.2 Sat May 30 16:21:37 2009 +++ src/external/bsd/pkg_install/dist/lib/license.c Sun Jun 21 11:42:20 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: license.c,v 1.1.1.2.2.2 2009/05/30 16:21:37 snj Exp $ */ +/* $NetBSD: license.c,v 1.1.1.2.2.3 2009/06/21 11:42:20 bouyer Exp $ */ /*- * Copyright (c) 2009 Joerg Sonnenberger <jo...@netbsd.org>. @@ -51,7 +51,7 @@ "gnu-gpl-v2 gnu-lgpl-v2 gnu-lgpl-v2.1 " "gnu-gpl-v3 gnu-lgpl-v3 " "original-bsd modified-bsd " - "x11 " + "x11 mit miros " "apache-1.1 apache-2.0 " "artistic artistic-2.0 " "cddl-1.0 " @@ -156,14 +156,16 @@ size_t len; len = strlen(license); - if (strspn(license, license_chars) != len) + if (strspn(license, license_chars) != len) { + warnx("Invalid character in license name at position %zu", len); return -1; + } return acceptable_license_internal(license, len); } static int -acceptable_pkg_license_internal(const char **licensep, int toplevel) +acceptable_pkg_license_internal(const char **licensep, int toplevel, const char *start) { const char *license = *licensep; int need_parenthesis, is_true = 0; @@ -182,7 +184,7 @@ for (;;) { if (*license == '(') { - switch (acceptable_pkg_license_internal(&license, 0)) { + switch (acceptable_pkg_license_internal(&license, 0, start)) { case -1: return -1; case 0: @@ -196,8 +198,10 @@ license += strspn(license, license_spaces); } else { len = strspn(license, license_chars); - if (len == 0) + if (len == 0) { + warnx("Invalid character in license name at position %zu", license - start + 1); return -1; + } if (acceptable_license_internal(license, len)) { if (expr_type != 2) @@ -209,40 +213,53 @@ license += len; len = strspn(license, license_spaces); - if (len == 0 && *license && *license != ')') + if (len == 0 && *license && *license != ')') { + warnx("Missing space at position %zu", license - start + 1); return -1; + } license += len; } if (*license == ')') { - if (!need_parenthesis) + if (!need_parenthesis) { + warnx("Missing open parenthesis at position %zu", license - start + 1); return -1; + } *licensep = license + 1; return is_true; } if (*license == '\0') { - if (need_parenthesis) + if (need_parenthesis) { + warnx("Unbalanced parenthesis at position %zu", license - start + 1); return -1; + } *licensep = license; return is_true; } if (strncmp(license, "AND", 3) == 0) { - if (expr_type == 1) + if (expr_type == 1) { + warnx("Invalid operator in OR expression at position %zu", license - start + 1); return -1; + } expr_type = 2; license += 3; } else if (strncmp(license, "OR", 2) == 0) { - if (expr_type == 2) + if (expr_type == 2) { + warnx("Invalid operator in AND expression at position %zu", license - start + 1); return -1; + } expr_type = 1; license += 2; } else { + warnx("Invalid operator at position %zu", license - start + 1); return -1; } len = strspn(license, license_spaces); - if (len == 0 && *license != '(') + if (len == 0 && *license != '(') { + warnx("Missing space at position %zu", license - start + 1); return -1; + } license += len; } @@ -254,12 +271,14 @@ { int ret; - ret = acceptable_pkg_license_internal(&license, 1); + ret = acceptable_pkg_license_internal(&license, 1, license); if (ret == -1) return -1; license += strspn(license, license_spaces); - if (*license) + if (*license) { + warnx("Trailing garbage in license specification"); return -1; + } return ret; } 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.8.1 src/external/bsd/pkg_install/dist/lib/version.h:1.1.1.2.8.2 --- src/external/bsd/pkg_install/dist/lib/version.h:1.1.1.2.8.1 Sat May 30 16:21:37 2009 +++ src/external/bsd/pkg_install/dist/lib/version.h Sun Jun 21 11:42:20 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.1.1.2.8.1 2009/05/30 16:21:37 snj Exp $ */ +/* $NetBSD: version.h,v 1.1.1.2.8.2 2009/06/21 11:42:20 bouyer 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 "20090528" +#define PKGTOOLS_VERSION "20090610" #endif /* _INST_LIB_VERSION_H_ */