On Wed, Oct 15, 2008 at 07:09:38PM +0200, frantisek holop wrote:
> here is what i want to do:
>
> i am using the ports framework to automate
> a process which overwrites/deletes some existing
> files of installed packages.
>
> overwriting is not a problem and deleting these
> mutilated packages with pkg_delete -q is ok
> too. but how can i delete some existing files
> before the package is actually installed?
>
> the very practical example of this is updating
> the lm fonts in the old tetex packages.
>
> filenames have changed, so the best is to delete
> certain directories and i tried with exec in PLIST
>
> @exec rm -rf
> /usr/local/share/texmf-dist/fonts/{afm,opentype,tfm,type1}/public/lm
> @exec rm -rf /usr/local/share/texmf-dist/fonts/{enc,map}/dvips/lm
>
> but this fails miserably because conflicts are detected
> much sooner.... Marc? :]
You won't get any cookie from me, because you're attacking this from the
wrong point of view.
You're still thinking you can get away with conflicts, whereas they're
standard in the update mechanism. What you're dealing with is an update,
probably a complicated one with several packages. If pkg_add were to
recognize this as an update, then most of your issues would go away.
If you look closely enough at the package code, you'll notice there's
an UpdateSet notion, which is a `block' of stuff that should be updated
all at once. Currently, it may contain several old packages, and one new
package. At some point, it should become n-to-n, and one of the most
central algorithms of pkg_add WILL be how to cut a big update operations
into as-small-as-possible updatesets so that you stay with a working
machine most of the time.
Did you read OpenBSD::Intro(3) ?