diff options
-rw-r--r-- | pkgtools/verifypc/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/verifypc/files/verifypc.sh | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/pkgtools/verifypc/Makefile b/pkgtools/verifypc/Makefile index 34e1d89e4e1..3e771a9804e 100644 --- a/pkgtools/verifypc/Makefile +++ b/pkgtools/verifypc/Makefile @@ -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 --git a/pkgtools/verifypc/files/verifypc.sh b/pkgtools/verifypc/files/verifypc.sh index a380b8621b1..d19e97202b4 100644 --- a/pkgtools/verifypc/files/verifypc.sh +++ b/pkgtools/verifypc/files/verifypc.sh @@ -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> @@ -83,7 +83,7 @@ search_file_in_depends() { # 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 @@ check_match() { 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 } |