pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/verifypc Update to 1.1:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/09c0b3160651
branches:  trunk
changeset: 500087:09c0b3160651
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Sun Oct 02 09:29:29 2005 +0000

description:
Update to 1.1:
- Raise an appropriate warning if pkg_admin pmatch fails due to an incorrect
  pattern (e.g., cairo>=0.5.2-head is unrecognized).

diffstat:

 pkgtools/verifypc/Makefile          |   4 ++--
 pkgtools/verifypc/files/verifypc.sh |  12 +++++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 777f2bf3b0c8 -r 09c0b3160651 pkgtools/verifypc/Makefile
--- a/pkgtools/verifypc/Makefile        Sun Oct 02 09:09:31 2005 +0000
+++ b/pkgtools/verifypc/Makefile        Sun Oct 02 09:29:29 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.1.1.1 2005/10/01 12:56:51 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2005/10/02 09:29:29 jmmv Exp $
 #
 
-DISTNAME=      verifypc-1.0
+DISTNAME=      verifypc-1.1
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 777f2bf3b0c8 -r 09c0b3160651 pkgtools/verifypc/files/verifypc.sh
--- a/pkgtools/verifypc/files/verifypc.sh       Sun Oct 02 09:09:31 2005 +0000
+++ b/pkgtools/verifypc/files/verifypc.sh       Sun Oct 02 09:29:29 2005 +0000
@@ -1,6 +1,6 @@
 #!@SH@
 #
-# $NetBSD: verifypc.sh,v 1.1.1.1 2005/10/01 12:56:51 jmmv Exp $
+# $NetBSD: verifypc.sh,v 1.2 2005/10/02 09:29:29 jmmv Exp $
 #
 # verifypc - Sanity check package dependencies according to pkg-config
 # Copyright (c) 2005 Julio M. Merino Vidal <jmmv%NetBSD.org@localhost>
@@ -83,7 +83,7 @@
 #
 check_match() {
     local dep="${1}" pcname="${2}" pcop="${3}" pcver="${4}"
-    local pkgdep pkgname
+    local out pkgdep pkgname ret
 
     if [ ${pcop} != ">" -a ${pcop} != ">=" -a ${pcop} != "-" ]; then
         warn "unsupported operator ${pcop} in ${pcname} dependency"
@@ -93,9 +93,15 @@
     pkgdep=$(echo ${dep} | cut -d : -f 1 | sed 's|>=|-|;s|>|-|')
     pkgname=$(echo ${pkgdep} | cut -d - -f 1)
 
-    if ! pkg_admin pmatch "${pkgname}${pcop}${pcver}" "${pkgdep}"; then
+    out=$(pkg_admin pmatch "${pkgname}${pcop}${pcver}" "${pkgdep}" 2>&1)
+    ret=$?
+    if [ ${ret} -ne 0 ]; then
         warn "${pcname} not correct; '${pcop} ${pcver}' needed"
         return 1
+    elif [ -n "${out}" ]; then
+        warn "${pcname} pmatch failed; wanted" \
+            "${pkgname}${pcop}${pcver}, have ${pkgdep}"
+        return 1
     fi
     return 0
 }



Home | Main Index | Thread Index | Old Index