Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 279510 - bzr_src_unpack in bzr eclass should return to workdir
Summary: bzr_src_unpack in bzr eclass should return to workdir
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jorge Manuel B. S. Vicetto
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-28 20:33 UTC by Wim Muskee
Modified: 2009-08-08 14:40 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Muskee 2009-07-28 20:33:23 UTC
Shouldn't bzr_src_unpack return to ${WORKDIR}{$P} after it's done unpacking?

An eautoreconf fails after unpacking with the following error unless I perform a cd ${WORKDIR}/${P} after the bzr_src_unpack command.

 * Failed Running aclocal !
 * 
 * Include in your bugreport the contents of:
 * 
 *   /var/tmp/portage/sys-fs/ltspfs-9999/temp/aclocal.out


the aclocal.out:

***** aclocal *****
***** PWD: /var/tmp/portage/sys-fs/ltspfs-9999/work
***** aclocal

aclocal-1.10: `configure.ac' or `configure.in' is required
Comment 1 Christian Faulhammer (RETIRED) gentoo-dev 2009-07-30 15:23:37 UTC
That's ${S}, but yes, I think.  Anyone has another opinion? Though I cannot see why it should not be in S after calling the function as it is a local directory change and we use popd to get back again to the inital directory.
Comment 2 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-07-30 16:51:49 UTC
(In reply to comment #1)
> That's ${S}, but yes, I think.  Anyone has another opinion? Though I cannot see
> why it should not be in S after calling the function as it is a local directory
> change and we use popd to get back again to the inital directory.

Christian,

I agree we should cd to ${S}. When src_unpack is called, there's nothing under ${WORKDIR}, so the final popd gets us back to ${WORKDIR}.
However, shouldn't src_prepare start in ${S}? As bzr_bootstrap starts by pushing ${S} and finishes by poping out of it, if the eautoreconf is being called after the call to bzr_src_prepare, the current dir will be the dir src_prepare starts in.

Wim,

can we see the ebuild you're using? What EAPI are you using and are you using the default bzr_src_prepare or are you overriding it?
Comment 3 Wim Muskee 2009-08-04 09:52:38 UTC
sys-fs-ltspfs/ltspfs-9999 from the LTSP overlay. Don't mind the comments, its still in development.

no EAPI specified, bzr_src_prepare is called from bzr_src_unpack


# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

if [[ ${PV} == 9999* ]]
then
        [[ ${PV} == 9999.* ]] && EBZR_REVISION="${PV/9999./}"
        EBZR_REPO_URI="http://bazaar.launchpad.net/~ltsp-upstream/ltspfs/ltspfs-trunk"
        inherit bzr autotools
else
        inherit autotools
        SRC_URI="mirror://gentoo/${P}.tar.bz2"
fi

DESCRIPTION="LTSP file system"
HOMEPAGE="http://www.ltsp.org/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND=">=dev-libs/glib-2.6"
RDEPEND="${DEPEND} >=sys-fs/fuse-2.7.2
        x11-libs/libX11"

src_unpack() {
        if [[ ${PV} == 9999* ]] ; then
                bzr_src_unpack
                cd ${WORKDIR}/${P}

                # FIXME: do we want to use bzr to generate a ChangeLog?
                # Create empty ChangeLog to please autoreconf
                touch ChangeLog
        else
                unpack ${P}.tar.bz2
        fi

        eautoreconf
}

src_install() {
        emake DESTDIR="${D}" install || die "einstall failed"

        # TODO: make NEWS and README install
        dodoc NEWS README
        docinto examples
        dodoc doc/examples/*
}
Comment 4 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-08-04 16:45:19 UTC
(In reply to comment #3)
> sys-fs-ltspfs/ltspfs-9999 from the LTSP overlay. Don't mind the comments, its
> still in development.
> 
> no EAPI specified, bzr_src_prepare is called from bzr_src_unpack
> 
> if [[ ${PV} == 9999* ]]
> then
>         [[ ${PV} == 9999.* ]] && EBZR_REVISION="${PV/9999./}"

PV is a read-only var. You'll want to use MY_PV instead. What are you trying to do with the replacement? It doesn't seem correct.

> EBZR_REPO_URI="http://bazaar.launchpad.net/~ltsp-upstream/ltspfs/ltspfs-trunk"

s/ltspfs/${PN}/

> KEYWORDS="~x86 ~amd64"

It follows alphabetical order so KEYWORDS="~amd64 ~x86" and you should only add keywords for arches you test.

> src_unpack() {
>         if [[ ${PV} == 9999* ]] ; then
>                 bzr_src_unpack
>                 cd ${WORKDIR}/${P}
> 
>                 # FIXME: do we want to use bzr to generate a ChangeLog?
>                 # Create empty ChangeLog to please autoreconf
>                 touch ChangeLog
>         else
>                 unpack ${P}.tar.bz2
>         fi

If you rely on the default src_unpack you can avoid src_unpack altogether as bzr_unpack will be called automatically if you inherit bzr.

>         eautoreconf

This should be called from src_prepare. Given your current ebuild, going straight for EAPI-2 seems to make more sense.

You may want to look at http://devmanual.gentoo.org/ for more info about ebuilds.
Comment 5 Wim Muskee 2009-08-08 14:40:59 UTC
The src_prepare and the EAPI 2 did the trick. It works now. I'll also look into the other problems. Thanks for the support.