* Torsten Veller <[EMAIL PROTECTED]>:
> > pkg_postinst() {
> > if [ ! -f ${ROOT}/usr/share/epic/script/local ]
> > then
> > elog "/usr/share/epic/script/local does not exist, I will now"
> > elog "create it. If you do not like the look/feel of this file,
> > or"
> > elog "if you'd prefer to use your own script, simply remove
> > this"
> > elog "file. If you want to prevent this file from being
> > installed"
> > elog "in the future, simply create an empty file with this
> > name."
> > cp ${WORKDIR}/epic4-local ${ROOT}/usr/share/epic/script/local
> ^^^^^^^^^^^^^^^^^^^^^^
> This probably does not exist.
> Installing a default file and testing in pkg_preinst() might be better.
>
> src_install() {
> [...]
> newins "${WORKDIR}"/epic4-local local.gentoodefault
> [...]
> }
> pkg_preinst() {
> if [ ! -f "${ROOT}"/usr/share/epic/script/local ] && \
> [ ! -f "${D}"/usr/share/epic/script/local ]
> then
> elog ...
> cp "${D}"/usr/share/epic/script/local{.gentoodefault,}
> fi
> }
:(
I thought it might be an advantage to record the file. But it isn't.
On upgrades portage calls: pkg_preinst, pkg_postinst, pkg_prerm,
pkg_postrm. So it first merges the new version and cleans the old one
later.
So for above pkg_preinst the file exists but it will be removed later
(if it wasn't modified)
Next version: Use your old pkg_postinst but don't use WOKDIR but the
installed default file. (If you don't want to merge the default file to
ROOT you install it but move to T in pkg_preinst and to ROOT in pkg_postinst.)
Comments?
--
.: Torsten Veller | :.
--
[EMAIL PROTECTED] mailing list