public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-dev] [RFC] QA Team's role
  @ 2006-02-28 19:11 99%                                         ` Thomas de Grenier de Latour
  0 siblings, 0 replies; 1+ results
From: Thomas de Grenier de Latour @ 2006-02-28 19:11 UTC (permalink / raw
  To: gentoo-dev

On Tue, 28 Feb 2006 13:02:10 -0500,
Alec Warner <antarus@gentoo.org> wrote:

> Ciaran McCreesh wrote:
> 
> >    if [ "${IS_UPGRADE}" = "1" ] ; then
> >        einfo "Removing old version ${REMOVE_PKG}"
> >
> >        emerge -C "${REMOVE_PKG}"
> >    fi
> >
> >  
> >
> Semantics of the logic aside, calling emerge from within an ebuild is
> a BIG nono.
> 

Reading the comments in the eclass, i can undestand the motivation.
 # why do we do this?  well ...
 #
 # normally, emerge -u installs a new version and then removes the
 # old version.  however, if the new version goes into a different
 # slot to the old version, then the old version gets left behind
 #
 # if USE=-vhosts, then we want to remove the old version, because
 # the user is relying on portage to do the magical thing for it


Two suggestions (don't really know what they are worth though):

* Short term, still evil, but less than calling emerge:
 pkg_postinst() {
    ...
    if ! use vhost ; then
       echo 0 > ${ROOT}var/db/pkg/${CATEGORY}/${PN}-${PVR}/SLOT
    fi
 }
This way, emerge's autoclean (the slow one, at the end) would 
remove old version of USE="-vhost" packages, since they would be 
all slotted "0".

* Long term, don't know how difficult it would be: Do some kind of
USE-expansion of the SLOT variable, to allow something like 
  SLOT="vhost? ( ${PVR} ) !vhost? ( 0 )"
This would only affect SLOT when read from porttree sure. In vartree, 
and in the ebuild env in general, it  should still be the reduced 
version ("${PVR}" or "0") that is used.

--
TGL.
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2006-02-26 22:22     [gentoo-dev] [RFC] QA Team's role Mark Loeser
2006-02-26 23:48     ` Stuart Herbert
2006-02-27  0:34       ` Mark Loeser
2006-02-27  9:00         ` Stuart Herbert
2006-02-27 17:08           ` Ciaran McCreesh
2006-02-27 20:26             ` Stuart Herbert
2006-02-27 20:37               ` Ciaran McCreesh
2006-02-27 20:49                 ` Re[2]: " Jakub Moc
2006-02-27 21:33                   ` Ciaran McCreesh
2006-02-28  9:38                     ` Re[2]: " Jakub Moc
2006-02-28 14:52                       ` Ciaran McCreesh
2006-02-28 15:12                         ` Patrick Lauer
2006-02-28 15:26                           ` Re[2]: " Jakub Moc
2006-02-28 15:42                             ` Ciaran McCreesh
2006-02-28 16:11                               ` Patrick Lauer
2006-02-28 16:35                                 ` Ciaran McCreesh
2006-02-28 17:00                                   ` Re[2]: " Jakub Moc
2006-02-28 17:09                                     ` Ciaran McCreesh
2006-02-28 17:30                                       ` Re[2]: " Jakub Moc
2006-02-28 17:38                                         ` Ciaran McCreesh
2006-02-28 18:02                                           ` Alec Warner
2006-02-28 19:11 99%                                         ` Thomas de Grenier de Latour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox