From owner-p4-projects@FreeBSD.ORG Fri Jul 20 08:28:27 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 237EA16A41A; Fri, 20 Jul 2007 08:28:27 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D86D916A418 for ; Fri, 20 Jul 2007 08:28:26 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C88C313C428 for ; Fri, 20 Jul 2007 08:28:26 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l6K8SQcu031035 for ; Fri, 20 Jul 2007 08:28:26 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l6K8SQd3031032 for perforce@freebsd.org; Fri, 20 Jul 2007 08:28:26 GMT (envelope-from gabor@freebsd.org) Date: Fri, 20 Jul 2007 08:28:26 GMT Message-Id: <200707200828.l6K8SQd3031032@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 123769 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2007 08:28:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=123769 Change 123769 by gabor@gabor_server on 2007/07/20 08:27:28 - Make use of bsd.commands.mk here Affected files ... .. //depot/projects/soc2006/gabor_destdir/Mk/bsd.port.subdir.mk#10 edit Differences ... ==== //depot/projects/soc2006/gabor_destdir/Mk/bsd.port.subdir.mk#10 (text+ko) ==== @@ -15,9 +15,6 @@ # own install script so that the entire system can be made # stripped/not-stripped using a single knob. [-s] # -# ECHO_MSG - Used to print all the '===>' style prompts - override this -# to turn them off [echo]. -# # OPSYS - Get the operating system type [`uname -s`] # # SUBDIR - A list of subdirectories that should be built as well. @@ -43,6 +40,7 @@ # Search for ports using either 'make search key=' # or 'make search name='. +.include "${PORTSDIR}/Mk/bsd.commands.mk" .MAIN: all @@ -52,10 +50,10 @@ .if !defined(NOPRECIOUSMAKEVARS) .if !defined(ARCH) -ARCH!= /usr/bin/uname -p +ARCH!= ${UNAME} -p .endif .if !defined(OSREL) -OSREL!= /usr/bin/uname -r | sed -e 's/[-(].*//' +OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//' .endif .if !defined(OSVERSION) .if exists(/usr/include/sys/param.h) @@ -68,22 +66,18 @@ .endif .endif -ID?= /usr/bin/id UID!= ${ID} -u .if exists(${LOCALBASE}/sbin/pkg_info) PKG_INFO?= ${LOCALBASE}/sbin/pkg_info .else PKG_INFO?= /usr/sbin/pkg_info .endif -SED?= /usr/bin/sed PKGINSTALLVER!= ${PKG_INFO} -P 2>/dev/null | ${SED} -e 's/.*: //' .if !defined(OPSYS) -OPSYS!= /usr/bin/uname -s +OPSYS!= ${UNAME} -s .endif -ECHO_MSG?= echo - # local customization of the ports tree .if exists(${.CURDIR}/Makefile.local) .include "${.CURDIR}/Makefile.local" @@ -194,13 +188,13 @@ fi; \ done; \ if [ $$found = 0 ]; then \ - ${ECHO} "Warning: directory $$d not in SUBDIR"; \ + ${ECHO_MSG} "Warning: directory $$d not in SUBDIR"; \ fi; \ fi; \ done @for s in ${SUBDIR}; do \ if ! [ -d ${.CURDIR}/$$s ]; then \ - ${ECHO} "Warning: directory $$s in SUBDIR does not exist"; \ + ${ECHO_MSG} "Warning: directory $$s in SUBDIR does not exist"; \ fi \ done .endif @@ -226,11 +220,11 @@ .else describe: @for sub in ${SUBDIR}; do \ - if test -d ${.CURDIR}/$${sub}; then \ + if ${TEST} -d ${.CURDIR}/$${sub}; then \ ${ECHO_MSG} "===> ${DIRPRFX}$${sub}"; \ cd ${.CURDIR}/$${sub}; \ ${MAKE} -B describe || \ - (echo "===> ${DIRPRFX}$${sub} failed" >&2; \ + (${ECHO_CMD} "===> ${DIRPRFX}$${sub} failed" >&2; \ exit 1) ;\ else \ ${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \ @@ -243,7 +237,7 @@ .if defined(PORTSTOP) readmes: readme ${SUBDIR:S/^/_/:S/$/.readmes/} @${ECHO_MSG} "===> Creating README.html for all ports" - @perl ${PORTSDIR}/Tools/make_readmes < ${INDEXDIR}/${INDEXFILE} + @${PERL} ${PORTSDIR}/Tools/make_readmes < ${INDEXDIR}/${INDEXFILE} .else readmes: readme .endif @@ -251,8 +245,8 @@ .if !target(readme) readme: - @rm -f README.html - @make README.html + @${RM} -f README.html + @${MAKE} README.html .endif .if (${OPSYS} == "NetBSD") @@ -277,32 +271,32 @@ MOVEDDIR?= ${PORTSDIR} MOVEDFILE?= MOVED -HTMLIFY= sed -e 's/&/\&/g' -e 's/>/\>/g' -e 's//\>/g' -e 's/ Creating README.html" + @${ECHO_CMD} "===> Creating README.html" @> $@.tmp .for entry in ${SUBDIR} .if exists(${entry}) .if defined(PORTSTOP) - @echo -n ''"`echo ${entry} | ${HTMLIFY}`"': ' >> $@.tmp + @${ECHO_CMD} -n ''"`${ECHO_CMD} ${entry} | ${HTMLIFY}`"': ' >> $@.tmp .else - @echo -n ''"`cd ${entry}; make package-name | ${HTMLIFY}`: " >> $@.tmp + @${ECHO_CMD} -n ''"`cd ${entry}; ${MAKE} package-name | ${HTMLIFY}`: " >> $@.tmp .endif - @echo `cd ${entry}; make -V COMMENT` | ${HTMLIFY} >> $@.tmp + @${ECHO_CMD} `cd ${entry}; ${MAKE} -V COMMENT` | ${HTMLIFY} >> $@.tmp .endif .endfor - @sort -t '>' +1 -2 $@.tmp > $@.tmp2 + @${SORT} -t '>' +1 -2 $@.tmp > $@.tmp2 .if exists(${DESCR}) @${HTMLIFY} ${DESCR} > $@.tmp3 .else @> $@.tmp3 .endif .if defined(COMMENT) - @echo "${COMMENT}" | ${HTMLIFY} > $@.tmp4 + @${ECHO_CMD} "${COMMENT}" | ${HTMLIFY} > $@.tmp4 .else .if exists(${COMMENTFILE}) @${HTMLIFY} ${COMMENTFILE} > $@.tmp4 @@ -310,8 +304,8 @@ @> $@.tmp4 .endif .endif - @cat ${README} | \ - sed -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \ + @${CAT} ${README} | \ + ${SED} -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \ -e '/%%COMMENT%%/r$@.tmp4' \ -e '/%%COMMENT%%/d' \ -e '/%%DESCR%%/r$@.tmp3' \ @@ -319,7 +313,7 @@ -e '/%%SUBDIR%%/r$@.tmp2' \ -e '/%%SUBDIR%%/d' \ > $@ - @rm -f $@.tmp $@.tmp2 $@.tmp3 $@.tmp4 + @${RM} -f $@.tmp $@.tmp2 $@.tmp3 $@.tmp4 .if !defined(NOPRECIOUSMAKEVARS) .MAKEFLAGS: \ @@ -340,7 +334,7 @@ _PORTSEARCH= \ here=${.CURDIR}; \ if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \ - echo "The ${.TARGET} target requires ${INDEXFILE}. Please run make index or make fetchindex."; \ + ${ECHO_MSG} "The ${.TARGET} target requires ${INDEXFILE}. Please run make index or make fetchindex."; \ else \ cd ${PORTSDIR}; \ if [ -z "$$key" -a -z "$$xkey" -a \ @@ -353,12 +347,12 @@ -z "$$rdeps" -a -z "$$xrdeps" -a \ -z "$$www" -a -z "$$xwww" ]; \ then \ - echo "The ${.TARGET} target requires a keyword parameter or name parameter,"; \ - echo "e.g.: \"make ${.TARGET} key=somekeyword\""; \ - echo "or \"make ${.TARGET} name=somekeyword\""; \ + ${ECHO_MSG} "The ${.TARGET} target requires a keyword parameter or name parameter,"; \ + ${ECHO_MSG} "e.g.: \"make ${.TARGET} key=somekeyword\""; \ + ${ECHO_MSG} "or \"make ${.TARGET} name=somekeyword\""; \ exit; \ fi; \ - awk -F\| -v there="$$here/" -v top="$$(pwd -P)" \ + ${AWK} -F\| -v there="$$here/" -v top="$$(pwd -P)" \ -v key="$$key" -v xkey="$$xkey" \ -v name="$$name" -v xname="$$xname" \ -v path="$$path" -v xpath="$$xpath" \ @@ -452,7 +446,7 @@ }' ${INDEXDIR}/${INDEXFILE}; \ if [ "$$name" -o "$$xname" ] && [ ${PORTSEARCH_MOVED} -gt 0 ]; \ then \ - awk -F\| -v name="$$name" -v xname="$$xname" \ + ${AWK} -F\| -v name="$$name" -v xname="$$xname" \ -v icase="$${icase:-${PORTSEARCH_IGNORECASE}}" \ 'BEGIN { \ if (icase) { \