Date: Thu, 8 Jun 2006 13:40:16 -0400 From: Vivek Khera <vivek@khera.org> To: freebsd ports <freebsd-ports@freebsd.org> Subject: Re: category for local ports Message-ID: <A0EF9771-D40B-45A2-B1AE-3110F267ACB7@khera.org> In-Reply-To: <20060608124526.GA86759@svm.csie.ntu.edu.tw> References: <20060424042318.GA59923@svm.csie.ntu.edu.tw> <20060424223523.GD749@picobyte.net> <444D6095.6030209@gmx.de> <20060425000446.GA97984@svm.csie.ntu.edu.tw> <E21A18CB-2BED-4C3F-A399-6D90B33E1CE5@khera.org> <44881315.3030705@FreeBSD.org> <20060608124526.GA86759@svm.csie.ntu.edu.tw>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 8, 2006, at 8:45 AM, Rong-En Fan wrote: >>> Also, is there no way to just add the dependencies from the local >>> ports >>> into the INDEX file? It takes about 25 minutes on my NFS server to >>> update that file from scratch. I'd love to be able to just >>> append my >>> local ports' entries onto it. >> >> Setting of EXTRA_CATEGORIES in pkgtools.conf does not help? > > IIRC, portupgrade or portsdb ignores it. I can try it with the latest > portupgrade later. Basically I've settled on this approach, which has worked out extremely well for the last couple of days at least :-) All local ports are in /usr/ports/local/kci-FOO for port named kci- FOO. I prefix all my local ports with 'kci-' to make things easy to identify. In /usr/ports/local is a Makefile with SUBDIR+=kci-FOO for each port just like any other category Makefile. In pkgtools.conf I add 'local' to EXTRA_CATEGORIES. This seems to be not used, but doesn't hurt. Then, to build the INDEX file I came up with a really great hack.... it goes like this: portsnap fetch portsnap update portsnap -I update localportindex portsdb --update where localportsindex is the following script. it takes advantage of the fact that Tools/make_index reads the basically same format as the INDEX file itself but will complain about not finding the port pathnames for the ports it has already processed. We just ignore the warnings it emits (bad style, yes... but it works for me) and only pull the lines we just created, ie, our local ports. This takes just a few seconds rather than 25 to 40 minutes, and is robust in that the data is correct 100% relative to the other entries in the index file. --cut here-- #!/bin/sh # hack to append our local ports to the /usr/ports/INDEX-6 file to let the # portupgrade and portinstall utilities see them. # Run this after normal update of INDEX file, such as portsnap or fetchindex # $Id: localportindex 463 2006-06-07 16:27:35Z khera $ # for FreeBSD 6.x PORTSBASE=/usr/ports INDEX=${PORTSBASE}/INDEX-6 LOCAL=${PORTSBASE}/local tmpfile=`/usr/bin/mktemp -t index` || exit 1 # make_index script complains a ton about using the INDEX file rather than the # raw "describe" output so we just toss the errors. this is probably a bad # thing to do, but nobody will die because of it... (cd $LOCAL; make describe; cat ${INDEX}) | perl ${PORTSBASE}/Tools/ make_index 2> /dev/null | grep ^kci > $tmpfile echo "Local ports appended to $INDEX file:" cat $tmpfile cat $tmpfile >> ${INDEX} rm -f $tmpfile --cut here--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A0EF9771-D40B-45A2-B1AE-3110F267ACB7>