You could handle it the way the baselayout ebuild does.

--Iggy

Stefaan wrote:
Hi!

I'm having an issue with the openafs-ebuild, and I don't see a
solution for the moment. I wondered if someone on the list would:

Prerequisite:
The ebuild needs to create the /afs directory, and remove that same
directory when it is uninstalled.

The obvious solution seems to do "keepdir", so portage would attempt
to make the directory and put a .keep file in there.  I say attempt,
because the following problem will occur during an re-merge or
upgrade, while the mountpoint is in use:
!!! Cannot write to '/afs'.
!!! Please check permissions and directories for broken symlinks.
etc.
(This is related to bug #9849, if I'm not mistaken)

The currently implemented solution is to do
pkg_prerm()
{
  rmdir /afs 2> /dev/null
}
pkg_postinst()
{
  mkdir /afs 2> /dev/null
}
which works fine when remerging an already emerged ebuild.  That's
because pkg_prerm is ran first, and pkg_postinst afterwards.
However, during an upgrade, pkg_prerm of the old version is ran
_after_ pkg_postinst of the new version.  This results in the
directory disappearing, and therefore afs failing to start.

Any input is greatly appreciated,
Thanks,
Stefaan



--
Stuff for sale -- http://www.brianandsara.net/temp/forsale.html
Gentoo Linux -- http://www.gentoo.org
IVTV -- http://ivtv.writeme.ch
--
gentoo-dev@gentoo.org mailing list

Reply via email to