Any freebsd ebuild that uses (un)lock-file() from freebsd-utils.eclass needs to make sure that when exiting prematurely (ie. die), that whatever files are locked/unlocked before die'ing. Otherwise, when going to re-merge that particular package, portage won't be able to clean ${WORKDIR}. Anyone have any ideas for doing this transparently?
I was thinking at one point of trying to integrate this stuff into portage so that it would unlock the relevant files only when trying to merge them. The only problem is that afaict python doesn't have a decent interface to chflags(). I could probably write it as a small module in C to be compiled as part of the portage install, if that looks like the best way to do things.
Some ideas: 1. have a die() function inside eclass that when called, returns the flags to its original state. 2. implement it inside portage. Although I think that this may be complex. 3. implement it as a separated module/application that could be placed inside die() and would run when system == FreeBSD. From now, I think we could use whatever is simpler and then implement a better/scalable one. Just my 0.02.
portage-2.0.51.19 is now stable and handles immutable flags transparently, so this is a non-issue now. Yay.