Date: Fri, 03 Mar 1995 10:31:59 +0000 From: Gary Palmer <gary@palmer.demon.co.uk> To: "Jordan K. Hubbard" <jkh@FreeBSD.org> Cc: ports@freefall.cdrom.com Subject: Re: Ok, I'm stumped. Message-ID: <898.794226719@palmer.demon.co.uk> In-Reply-To: Your message of "Thu, 02 Mar 1995 23:49:50 PST." <199503030749.XAA02499@time.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <199503030749.XAA02499@time.cdrom.com>, "Jordan K. Hubbard" writes: >The problem is that I'm kinda stumped on how to do it. Setting a variable >called NO_foobar to disable the foobar port is all well and good, but >we've got no variable anywhere that defines a port as simply "foobar"! :-( >We've got ${DISTNAME} but that's unfortunately often set to things like >foobar_11b-20.1 which doesn't make a good shell variable name. Or we've >got ${.CURDIR}, but that's set to /usr/ports/blah/bar/foobar. Sigh. Yeah - that one has bitten me before, but I can't remember when :-( >What would be neat would be some way of picking off the `entry' in >bsd.port.subdir.mk and checking to see if the value of >"X${NO_$${ENTRY}}" = "X", but I don't see any easy way of doing the >recursive shell variable expansion. Ahem. Sidestep the problem. >Any suggestions? This is where my knowledge of `sh' leaves off! :-( Try this patch : Index: bsd.port.subdir.mk =================================================================== RCS file: /home/cvs/src/share/mk/bsd.port.subdir.mk,v retrieving revision 1.9 diff -c -r1.9 bsd.port.subdir.mk *** 1.9 1995/01/05 01:46:05 --- bsd.port.subdir.mk 1995/03/03 10:29:48 *************** *** 13,28 **** _SUBDIRUSE: .USE @for entry in ${SUBDIR}; do \ ! (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ ! echo "===> ${DIRPRFX}$${entry}.${MACHINE}"; \ ! edir=$${entry}.${MACHINE}; \ ! cd ${.CURDIR}/$${edir}; \ ! else \ ! echo "===> ${DIRPRFX}$$entry"; \ ! edir=$${entry}; \ ! cd ${.CURDIR}/$${edir}; \ fi; \ - ${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \ done ${SUBDIR}:: --- 13,38 ---- _SUBDIRUSE: .USE @for entry in ${SUBDIR}; do \ ! OK=""; \ ! for dud in $$DUDS; do \ ! if [ $${dud} = $${entry} ]; then \ ! OK="false"; \ ! echo "===> ${DIRPRFX}$${entry} skipped"; \ ! fi; \ ! done; \ ! if [ "$$OK" = "" ]; then \ ! if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ ! echo "===> ${DIRPRFX}$${entry}.${MACHINE}"; \ ! edir=$${entry}.${MACHINE}; \ ! cd ${.CURDIR}/$${edir}; \ ! else \ ! echo "===> ${DIRPRFX}$$entry"; \ ! edir=$${entry}; \ ! cd ${.CURDIR}/$${edir}; \ ! fi; \ ! ${MAKE} ${.TARGET:realinstall=install} \ ! DIRPRFX=${DIRPRFX}$$edir/; \ fi; \ done ${SUBDIR}:: Then: When you find a duff port do: setenv DUDS <port name> If you have more than one, just do setenv DUDS "<port name> <port name>" (or if you are just adding a new DUD then setenv DUDS "$DUDS <port name>" should do the trick) It should work (it seemed to in my limited tests here). Any good? Gary
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?898.794226719>