Re: [gentoo-dev] Re: scm eclasses/ebuilds and revision logging

2008-01-14 Thread Bernd Steinhauser
I did now try this for a while and it works quite good, it only has one
problem. If the package gets unmerged, for whatever reason, then the
file will be unmerged. I know, that it is possible to keep dirs, but is
it possible to keep files (without touching them manually outside portage)?

Bernd

Ryan Hill schrieb:
 Bernd Steinhauser wrote:
 I'm aware of the fact, that the revision of the currently installed
 package is part of the environment and that is saved, but I'm not only
 interested in the revision of the currently installed version, but also
 in the revision of the previously installed version. Just wanted to
 emphasize that again. ;)

 Hope someone comes up with some good ideas. ;)
 
 Would something like this work for you?
 
 pkg_preinst() {
 local pkgdate=$(date +%Y%m%d %H:%M:%S)
 subversion_wc_info
 if [[ -n ${PORT_SCMDIR} ]]; then
 [[ -e ${ROOT}/${PORT_SCMDIR}/${PN}.revision ]] \
  cp ${ROOT}/${PORT_SCMDIR}/${PN}.revision ${T}
 echo ${pkgdate} - ${P} was merged at revision
 ${ESVN_WC_REVISION} \
  ${T}/${PN}.revision
 insinto ${PORT_SCMDIR}
 doins ${T}/${PN}.revision
 fi
 }
 
 that's for subversion of course.  set PORT_SCMDIR in make.conf.
 
 

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



Re: [gentoo-dev] Re: scm eclasses/ebuilds and revision logging

2008-01-12 Thread Bernd Steinhauser
Ryan Hill schrieb:
 Bernd Steinhauser wrote:
 I'm aware of the fact, that the revision of the currently installed
 package is part of the environment and that is saved, but I'm not only
 interested in the revision of the currently installed version, but also
 in the revision of the previously installed version. Just wanted to
 emphasize that again. ;)

 Hope someone comes up with some good ideas. ;)
 
 Would something like this work for you?
 
 pkg_preinst() {
 local pkgdate=$(date +%Y%m%d %H:%M:%S)
 subversion_wc_info
 if [[ -n ${PORT_SCMDIR} ]]; then
 [[ -e ${ROOT}/${PORT_SCMDIR}/${PN}.revision ]] \
  cp ${ROOT}/${PORT_SCMDIR}/${PN}.revision ${T}
 echo ${pkgdate} - ${P} was merged at revision
 ${ESVN_WC_REVISION} \
  ${T}/${PN}.revision
 insinto ${PORT_SCMDIR}
 doins ${T}/${PN}.revision
 fi
 }
 
 that's for subversion of course.  set PORT_SCMDIR in make.conf.
 
 

This is sort of what I thought of (of course you brought it into
detail), but I didn't know if there is maybe a better way, or if there
is actually a way to do this after the installation and not in preinst.
But I guess if nobody comes up with something better this is the way to
do it.
Maybe sth. like elog, just you don't log a message to summary.log, but
you log the revision of the package.
(Meaning, that you can use elog in every phase of an ebuild.)

Bernd
-- 
gentoo-dev@lists.gentoo.org mailing list