Mailing List Archive

Re: gentoo-x86 commit in net-irc/epic4: ChangeLog epic4-2.8.ebuild
* "Raul Porcel (armin76)" <armin76@gentoo.org>:
> armin76 07/09/20 19:10:45
>
> Modified: ChangeLog
> Added: epic4-2.8.ebuild
> Log:
> Version bump
> (Portage version: 2.1.3.9)
>
> 1.1 net-irc/epic4/epic4-2.8.ebuild
>
> file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/epic4/epic4-2.8.ebuild?rev=1.1&view=markup
> plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/epic4/epic4-2.8.ebuild?rev=1.1&content-type=text/plain
>
> Index: epic4-2.8.ebuild
> ===================================================================
> # Copyright 1999-2007 Gentoo Foundation
> # Distributed under the terms of the GNU General Public License v2
> # $Header: /var/cvsroot/gentoo-x86/net-irc/epic4/epic4-2.8.ebuild,v 1.1 2007/09/20 19:10:44 armin76 Exp $
>
> inherit flag-o-matic eutils
>
> HELP_V="20050315"
>
> DESCRIPTION="Epic4 IRC Client"
> HOMEPAGE="http://epicsol.org/"
> SRC_URI="ftp://ftp.epicsol.org/pub/epic/EPIC4-PRODUCTION/${P}.tar.bz2
> ftp://prbh.org/pub/epic/EPIC4-PRODUCTION/epic4-help-${HELP_V}.tar.gz
> mirror://gentoo/epic4-local.bz2"
>
[...]
> 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
}


--
.: Regards Torsten | :.
--
gentoo-dev@gentoo.org mailing list
Re: gentoo-x86 commit in net-irc/epic4: ChangeLog epic4-2.8.ebuild [ In reply to ]
* Torsten Veller <tove@gentoo.org>:
> > 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 | :.
--
gentoo-dev@gentoo.org mailing list