diff options
author | abs <abs@pkgsrc.org> | 2002-06-20 09:17:40 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2002-06-20 09:17:40 +0000 |
commit | 0b82fd4e9f35ac775f79165fdf3585aa5de47cd5 (patch) | |
tree | 137ac148657d43d0e9f97839e607c4efd84db7b6 /pkgtools/pkgchk | |
parent | b9035b82a07eafa2c51f0edd0251307792fbc74d (diff) | |
download | pkgsrc-0b82fd4e9f35ac775f79165fdf3585aa5de47cd5.tar.gz |
Update pkgchk to 1.30
Avoid problems if a file 'x' is in the current directory with obvious use
of .PHONY. Implement and use extract_mk_dir_var().
Diffstat (limited to 'pkgtools/pkgchk')
-rw-r--r-- | pkgtools/pkgchk/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkgchk/files/pkgchk.sh | 54 |
2 files changed, 22 insertions, 36 deletions
diff --git a/pkgtools/pkgchk/Makefile b/pkgtools/pkgchk/Makefile index 26a64d102bf..b588478b0bd 100644 --- a/pkgtools/pkgchk/Makefile +++ b/pkgtools/pkgchk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.31 2002/06/10 15:29:38 tron Exp $ +# $NetBSD: Makefile,v 1.32 2002/06/20 09:17:40 abs Exp $ -DISTNAME= pkgchk-1.29 +DISTNAME= pkgchk-1.30 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkgchk/files/pkgchk.sh b/pkgtools/pkgchk/files/pkgchk.sh index ac127b1b615..0e33df1dd87 100755 --- a/pkgtools/pkgchk/files/pkgchk.sh +++ b/pkgtools/pkgchk/files/pkgchk.sh @@ -1,6 +1,6 @@ #!/bin/sh -e # -# $Id: pkgchk.sh,v 1.32 2002/06/09 14:43:39 tron Exp $ +# $Id: pkgchk.sh,v 1.33 2002/06/20 09:17:40 abs Exp $ # # TODO: Handle updates with dependencies via binary packages @@ -70,7 +70,7 @@ echo_n() extract_make_vars() { - MAKEDATA="x:\n"; + MAKEDATA=".PHONY: x\nx:\n"; for var in $* ; do MAKEDATA=$MAKEDATA"\t@echo $var=\${$var}\n" done @@ -78,43 +78,26 @@ extract_make_vars() sed -e 's/[^=]*=/&"/' -e 's/$/"/'` } -extract_variables() +# $1 = name of variable +# $2 = default value +extract_mk_dir_var() { - # Establish PKGSRCDIR - # - - if [ -z "$PKGSRCDIR" ];then - if [ -f $MAKECONF ];then - eval `printf 'BSD_PKG_MK=1\nx:\n\t@echo PKGSRCDIR=${PKGSRCDIR}\n' | ${MAKE} -f - -f $MAKECONF x` - elif [ -f /etc/mk.conf ];then - eval `printf 'BSD_PKG_MK=1\nx:\n\t@echo PKGSRCDIR=${PKGSRCDIR}\n' | ${MAKE} -f - -f /etc/mk.conf x` + if [ -z "`eval echo \\$$1`" ] ; then + eval `printf "BSD_PKG_MK=1\n.PHONY: x\nx:\n\t@echo $1="'$'"{$1}\n" | ${MAKE} -f - -f $MAKECONF x` + if [ -z "`eval echo \\$$1`" ]; then + eval "$1=$2" fi - if [ -z "$PKGSRCDIR" ];then - PKGSRCDIR=/usr/pkgsrc + if [ ! -d `eval echo \\$$1` ];then + echo "Unable to locate $1 `eval echo \\$$1`" + exit 1; fi fi - if [ ! -d $PKGSRCDIR ];then - echo "Unable to locate PKGSRCDIR '$PKGSRCDIR'" - exit 1; - fi - - # Establish PKG_DBDIR - # + } - if [ -z "$PKG_DBDIR" ];then - if [ -f $MAKECONF ];then - eval `printf 'BSD_PKG_MK=1\nx:\n\t@echo PKG_DBDIR=${PKG_DBDIR}\n' | ${MAKE} -f - -f $MAKECONF x` - elif [ -f /etc/mk.conf ];then - eval `printf 'BSD_PKG_MK=1\nx:\n\t@echo PKG_DBDIR=${PKG_DBDIR}\n' | ${MAKE} -f - -f /etc/mk.conf x` - fi - if [ -z "$PKG_DBDIR" ];then - PKG_DBDIR=/var/db/pkg - fi - fi - if [ ! -d $PKG_DBDIR ];then - echo "Unable to locate PKG_DBDIR '$PKG_DBDIR'" - exit 1; - fi +extract_variables() + { + extract_mk_dir_var PKGSRCDIR /usr/pkgsrc + extract_mk_dir_var PKG_DBDIR /var/db/pkg # Now we have PKGSRCDIR, use it to determine PACKAGES, and PKGCHK_CONF # as well as AWK, GREP, SED, PKGCHK_TAGS and PKGCHK_NOTAGS @@ -315,6 +298,9 @@ fi test -n "$MAKE" || MAKE="@MAKE@" test -n "$MAKECONF" || MAKECONF="@MAKECONF@" +if [ ! -f $MAKECONF ] ; then + MAKECONF=/etc/mk.conf +fi # grabbed from GNU configure if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then |