On Mon, 03 Jan 2011 19:16:13 +0100
Thomas Sachau <to...@gentoo.org> wrote:

> src_unpack() {
>       unpack ${A}
>       mv *-${PN}-* "${S}"
> }
> 
> This saves a line and does not require the redefinition of S inside
> the function.

It should probably die() though. I've looked at opera tarballs again,
and in fact they are still varying the directory based on both the OS
and the arch.

The "x86-fbsd" tarball has "opera-11.00-1156.i386.freebsd" whereas plain
"x86" is brought to users as "opera-11.00-1156.i386.linux". This isn't
the reason why I started modifying S based on what had been unpacked,
though - it was becomes sometimes I'd see "opera_11.00-1156.i386.linux"
instead of "opera-11.00-1156.i386.linux" too, and other punctuational
flux.

Anyway, I've gone now from many lines to a single extra line in
src_unpack():


--- opera-11.00.1156.ebuild     22 Dec 2010 16:14:34 -0000      1.3
+++ opera-11.00.1156.ebuild     3 Jan 2011 20:06:25 -0000       1.5
 
 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
+     mv -v * "${S}" || die
 }
 
 src_prepare() {


That sure helped.


     jer

Reply via email to