On Mon, 03 Jan 2011 16:40:57 +0200
Samuli Suominen <[email protected]> wrote:

> Quoting PMS, Chapter 8:
> 
> "All ebuild-defined variables discussed in this chapter must be
> defined independently of any system, profile or tree dependent data,
> and must not vary depending upon the ebuild phase."
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=blob_plain;f=ebuild-vars.tex;hb=HEAD
> 
> 
> 
> This is very inconvinent rule for example, github tarballs where the
> directory changes with every release. I've used this:

> src_unpack() {
>       unpack ${A}
>       cd *-${PN}-*
>       S=`pwd`
> }

I've been doing that in www-client/opera for ages, having got fed up
with the varying packaging conventions used upstream:

src_unpack() {
  unpack ${A}
  if [[ ! -d ${S} ]]; then
    cd "${WORKDIR}"/${PN}* || die "failed to enter work directory"
    S="$(pwd)"
    einfo "Setting WORKDIR to ${S}"
  fi
}

I've never had complaints.

> Far as I know, S= isn't used to generate metadata cache, so it's PMS
> that need fixing for it's wording:
> 
> "All ebuild-defined variables used to generate metadata cache,
> discussed in this chapter..."

As far as I can tell, the chapter does not mention S, but it could be
more specific. Don't see why it should, though.


     jer

Reply via email to