Date: Sun, 13 May 2007 12:03:32 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Kris Kennaway <kris@obsecurity.org> Cc: freebsd-hackers@freebsd.org Subject: Re: DPS Initial Ideas Message-ID: <4646F084.3080601@infracaninophile.co.uk> In-Reply-To: <20070513084404.GA35648@xor.obsecurity.org> References: <20070512004209.GA12218@lpthe.jussieu.fr> <17989.8202.624522.136573@bhuda.mired.org> <20070512090935.GA13929@lpthe.jussieu.fr> <20070512193302.GA24673@xor.obsecurity.org> <20070512214422.GA88480@lpthe.jussieu.fr> <20070512222435.GA28981@xor.obsecurity.org> <4646C249.6070103@infracaninophile.co.uk> <20070513084404.GA35648@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Kris Kennaway wrote: > On Sun, May 13, 2007 at 08:46:17AM +0100, Matthew Seaman wrote: >> Kris Kennaway wrote: >> >>> The problem is that maintaining the INDEX is expensive and/or tricky. >>> p5-FreeBSD-Portindex comes close but seems to have some wrinkles. >> If you'ld just tell me what you perceive the wrinkles to be, then I'd >> have a fighting chance at addressing them, which I would be glad to do... > > I only looked today so I didn't have time to fully investigate things, > which is why you didn't hear from me directly yet :) > > Basically there are some differences (extra whitespace, etc) that are > cosmetic but which make validation against the full INDEX build more > difficult, but the major one seems to be that ports that change their > name dynamically (depending on e.g. installed ports detected, or > changes in build options) do not seem to have this reflected in the > incremental index. Extra whitespace I can fix for you -- it's just the COMMENT field which is affected IIRC. I just copy the string exactly as shown in the port's Makefile. make index collapses multiple whitespace to single. As you say, cosmetic. Also I get the sorting 'for free' by using the properties of BDB btrees. Unfortunately it disagrees somewhat with the collation order generated by sort. Ports that change their name dynamically are tricky. If it really is an automatic change without administrative intervention then there's not a lot I can do -- and I believe such behaviour is held to be a bug by the ports system. I do use the port directory as the unique key for referring to any port, whereas make index uses the pkgname when writing out the INDEX, which causes some differences. An example: games/freeciv. If you have one of the gtk packages installed (as I do) it will automatically change package name: happy-idiot-talk:...ports/games/freeciv:% make -V PKGNAME freeciv-gtk2-2.0.8_2 This generates an warning about 'duplicate package name' with make index, (due to a collision with the games/freeciv-gtk2 slave port) and only one row in the final INDEX. With FreeBSD::Portindex, no errors are generated at all, and there are entries for both the main and slave ports like so: happy-idiot-talk:/usr/ports:% grep ^freeciv-gtk2 INDEX-6 | cut -c 1-78 freeciv-gtk2-2.0.8_2|/usr/ports/games/freeciv|/usr/local|Free turn-based multi freeciv-gtk2-2.0.8_2|/usr/ports/games/freeciv-gtk2|/usr/local|Free turn-based I can certainly add a check for duplicate PKGNAME and emit warnings. In order to be sure of getting the canonical INDEX-N you'ld need a system with no ports installed. Well, other than p5-FreeBSD-Portindex and dependencies -- none of which suffer from this problem. Where the package name changes due to explicit administrative choice, in the main that's either due to setting variables in the environment (which make later picks up), setting variables in the make infrastructure (eg /etc/make.conf) or using one of those blue and grey options screens, which changes a Makefile under /var/db/ports. There's already a facility for scrubbing everything out of the environment except USER, HOME, PATH, SHELL, TERM and TERMCAP Changes in well known Makefiles like /etc/make.conf or any Makefiles under /usr/ports will either trigger a warning message (generally saying you need to reinitialise the cache, because otherwise it would lead to rechecking every port, which might be a big waste of time depending on the nature of the changes to the makefile) or cause any port that includes that Makefile to be re-checked and its cache entry updated. That will pick up most of the places where an administrator might make changes to affect how ports are compiled, although a sufficiently ingenious admin could still put things in such odd places p5-FreeBSD-Portindex wouldn't find them... Tracking changes to OPTIONS settings is a good point though. I need to implement that. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGRvCE8Mjk52CukIwRCEvTAJ98KhyNpbVoSNQ7Aisk6MNQIrDg9ACfXeGc Pjnzdg9a5syzSFs6lKsJkzg= =/Vzb -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4646F084.3080601>