pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/lib Sync with basesrc: do n...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fbc55af79082
branches:  trunk
changeset: 503066:fbc55af79082
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Nov 13 19:51:14 2005 +0000

description:
Sync with basesrc: do not use errx in dewey.c; handle -1 return value
from dewey_match in pmatch.

diffstat:

 pkgtools/pkg_install/files/lib/dewey.c |   6 +++---
 pkgtools/pkg_install/files/lib/str.c   |  11 ++++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (60 lines):

diff -r a33c580f8ad0 -r fbc55af79082 pkgtools/pkg_install/files/lib/dewey.c
--- a/pkgtools/pkg_install/files/lib/dewey.c    Sun Nov 13 19:50:31 2005 +0000
+++ b/pkgtools/pkg_install/files/lib/dewey.c    Sun Nov 13 19:51:14 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dewey.c,v 1.3 2005/11/08 20:17:56 wiz Exp $    */
+/*     $NetBSD: dewey.c,v 1.4 2005/11/13 19:51:14 wiz Exp $    */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -227,7 +227,7 @@
 
 /*
  * Perform dewey match on "pkg" against "pattern".
- * Return 1 on match, 0 otherwise
+ * Return 1 on match, 0 on non-match, -1 on error.
  */
 int
 dewey_match(const char *pattern, const char *pkg)
@@ -242,7 +242,7 @@
                return 0;
        }
        if ((sep = strpbrk(pattern, "<>")) == NULL)
-               errx(EXIT_FAILURE, "dewey_match: '<' or '>' expected in `%s'", pattern);
+               return -1;
        /* compare name lengths */
        if ((sep-pattern != version-pkg) ||
            strncmp(pkg, pattern, (size_t)(version-pkg)) != 0)
diff -r a33c580f8ad0 -r fbc55af79082 pkgtools/pkg_install/files/lib/str.c
--- a/pkgtools/pkg_install/files/lib/str.c      Sun Nov 13 19:50:31 2005 +0000
+++ b/pkgtools/pkg_install/files/lib/str.c      Sun Nov 13 19:51:14 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.14 2005/11/05 13:20:09 wiz Exp $     */
+/*     $NetBSD: str.c,v 1.15 2005/11/13 19:51:14 wiz Exp $     */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "Id: str.c,v 1.5 1997/10/08 07:48:21 charnier Exp";
 #else
-__RCSID("$NetBSD: str.c,v 1.14 2005/11/05 13:20:09 wiz Exp $");
+__RCSID("$NetBSD: str.c,v 1.15 2005/11/13 19:51:14 wiz Exp $");
 #endif
 #endif
 
@@ -196,8 +196,13 @@
                return alternate_match(pattern, pkg);
        }
        if (strpbrk(pattern, "<>") != (char *) NULL) {
+               int ret;
+
                /* perform relational dewey match on version number */
-               return dewey_match(pattern, pkg);
+               ret = dewey_match(pattern, pkg);
+               if (ret < 0)
+                       errx(EXIT_FAILURE, "dewey_match returned error");
+               return ret;
        }
        if (strpbrk(pattern, "*?[]") != (char *) NULL) {
                /* glob match */



Home | Main Index | Thread Index | Old Index