Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 596306

Summary: net-wireless/hostapd-2.6: ebuild broken in EAPI=6
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Bjarke Istrup Pedersen (RETIRED) <gurligebis>
Status: RESOLVED FIXED    
Severity: normal CC: cilly, klausman, qa, toralf
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-06 06:18:28 UTC
* ERROR: net-wireless/hostapd-2.6::gentoo failed (prepare phase):
 *   eapply_user (or default) must be called in src_prepare()!

Why are you committing untested ebuilds?
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-10-06 07:49:47 UTC
commit 14d0f0fabefbc5cc25f28dab4b8402f1a82a3c89
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Thu Oct 6 09:47:03 2016

    net-wireless/hostapd: Fixed incomplete EAPI-6 conversion (bug #596306).

    Package-Manager: portage-2.3.1
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>



Sorry to hijack this but I need the ebuild being installable.
Comment 2 Tobias Klausmann (RETIRED) gentoo-dev 2016-10-06 08:26:02 UTC
*** Bug 596324 has been marked as a duplicate of this bug. ***
Comment 3 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2016-10-06 12:49:31 UTC
Seems like I forgot to copy the final version into my git tree before commiting it :S .

Thanks for fixing it.
Comment 4 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2016-10-06 12:52:39 UTC
*** Bug 596330 has been marked as a duplicate of this bug. ***
Comment 5 cilly 2016-10-06 13:39:04 UTC
Well, the final version is not working, the user patches won't apply, the working directory is wrong and set to:

/var/tmp/portage/net-wireless/hostapd-2.6/work/hostapd-2.6/hostapd

Since src/ lives in hostapd-2.6 which needs to be patched, afaik the working directory for patches and source prepare should be:

/var/tmp/portage/net-wireless/hostapd-2.6/work/hostapd-2.6

probably a workaround like:

src_prepare() {
    cd "${S}/.."
    default
}

might help.

#### below snipped of failed patching…

>>> Preparing source in /var/tmp/portage/net-wireless/hostapd-2.6/work/hostapd-2.6/hostapd ...
 * Applying patches from /etc/portage/patches/net-wireless/hostapd-2.6 ...
 *   hostapd-2.6-optional_rfkill.patch ...
The text leading up to this was:
--------------------------
|diff -urNp src.original/drivers/drivers.mak src/drivers/drivers.mak
|--- src.original/drivers/drivers.mak   2016-10-02 20:51:11.000000000 +0200
|+++ src/drivers/drivers.mak    2016-10-06 15:19:48.911571053 +0200
--------------------------
No file to patch.  Skipping patch.
4 out of 4 hunks ignored
The text leading up to this was:
--------------------------
|diff -urNp src.original/drivers/rfkill.h src/drivers/rfkill.h
|--- src.original/drivers/rfkill.h      2016-10-02 20:51:11.000000000 +0200
|+++ src/drivers/rfkill.h       2016-10-06 15:22:08.936944380 +0200
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored                                                                                                                                                                                     [ !! ]
 * ERROR: net-wireless/hostapd-2.6::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/net-wireless/hostapd-2.6/hostapd-2.6-optional_rfkill.patch
 *
 * Call stack:
 *               ebuild.sh, line  115:  Called src_prepare
 *             environment, line 2172:  Called default
 *      phase-functions.sh, line  805:  Called default_src_prepare
 *      phase-functions.sh, line  870:  Called __eapi6_src_prepare
 *             environment, line  192:  Called eapply_user
 *             environment, line  568:  Called eapply '/etc/portage/patches/net-wireless/hostapd-2.6'
 *             environment, line  545:  Called _eapply_patch '/etc/portage/patches/net-wireless/hostapd-2.6/hostapd-2.6-optional_rfkill.patch' '  '
 *             environment, line  487:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/net-wireless/hostapd-2.6/hostapd-2.6-optional_rfkill.patch'
 *   isolated-functions.sh, line  117:  Called die
 * The specific snippet of code:
 *              die "$@"
 *
 * If you need support, post the output of `emerge --info '=net-wireless/hostapd-2.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-wireless/hostapd-2.6::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-wireless/hostapd-2.6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/hostapd-2.6/temp/environment'.
 * Working directory: '/var/tmp/portage/net-wireless/hostapd-2.6/work/hostapd-2.6/hostapd'
 * S: '/var/tmp/portage/net-wireless/hostapd-2.6/work/hostapd-2.6/hostapd'
Comment 6 cilly 2016-10-06 13:48:36 UTC
Confirmed, the following change will resolve the issue:

diff -urNp hostapd-2.6.ebuild /usr/portage/net-wireless/hostapd/hostapd-2.6.ebuild 
--- hostapd-2.6.ebuild  2016-10-06 15:45:08.063603715 +0200
+++ /usr/portage/net-wireless/hostapd/hostapd-2.6.ebuild        2016-10-06 09:47:03.000000000 +0200
@@ -28,7 +28,6 @@ RDEPEND="${DEPEND}"
 S="${S}/${PN}"
 
 src_prepare() {
-       cd "${S}/.."
        default
 
        sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \
Comment 7 cilly 2016-10-06 23:42:34 UTC
(In reply to cilly from comment #6)
> Confirmed, the following change will resolve the issue:
> 
> diff -urNp hostapd-2.6.ebuild
> /usr/portage/net-wireless/hostapd/hostapd-2.6.ebuild 
> --- hostapd-2.6.ebuild  2016-10-06 15:45:08.063603715 +0200
> +++ /usr/portage/net-wireless/hostapd/hostapd-2.6.ebuild        2016-10-06
> 09:47:03.000000000 +0200
> @@ -28,7 +28,6 @@ RDEPEND="${DEPEND}"
>  S="${S}/${PN}"
>  
>  src_prepare() {
> -       cd "${S}/.."
>         default
>  
>         sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \

Okay, this diff is in wrong direction, the cd line should be an addition.
Comment 8 Ulrich Müller gentoo-dev 2016-10-07 01:09:42 UTC
(In reply to cilly from comment #7)
> >  S="${S}/${PN}"
> >  
> >  src_prepare() {
> > -       cd "${S}/.."
> >         default
> 
> Okay, this diff is in wrong direction, the cd line should be an addition.

<QA hat>
No, ebuilds should generally call eapply_user in ${S}. If the source lives somewhere else, then S has a wrong value, in the first place.

Also, S="${S}/${PN}" in global scope? That's another QA violation.
PMS reference: https://projects.gentoo.org/pms/6/pms.html#x1-118002
</QA hat>
Comment 9 cilly 2016-10-07 01:18:01 UTC
(In reply to Ulrich Müller from comment #8)
> No, ebuilds should generally call eapply_user in ${S}. 

In EAPI 6 eapply_user is the default, or did I miss something?
Comment 10 Ulrich Müller gentoo-dev 2016-10-07 05:04:20 UTC
(In reply to cilly from comment #9)
> (In reply to Ulrich Müller from comment #8)
> > No, ebuilds should generally call eapply_user in ${S}. 
> 
> In EAPI 6 eapply_user is the default, or did I miss something?

Yes, the default src_prepare will call it. (So nothing wrong with "default" instead of directly "eapply_user" in src_prepare.)
Comment 11 Wolfram Schlich (RETIRED) gentoo-dev 2016-10-07 08:18:48 UTC
Should have been fixed by...

  06 Oct 2016; Lars Wendler <polynomial-c@gentoo.org> hostapd-2.6.ebuild:
  Fixed incomplete EAPI-6 conversion (bug #596306).

...?
Comment 12 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-10-25 07:30:14 UTC
(In reply to Wolfram Schlich from comment #11)
> Should have been fixed by...
> 
>   06 Oct 2016; Lars Wendler <polynomial-c@gentoo.org> hostapd-2.6.ebuild:
>   Fixed incomplete EAPI-6 conversion (bug #596306).
> 
> ...?

Indeed.
Comment 13 cilly 2016-11-23 09:30:32 UTC
Why is this marked as resolved and fixed while it is still broken?
Comment 14 cilly 2016-11-23 09:37:34 UTC
In EAPI 6 default means user-patches support. But user-patches won't apply, see my earlier comments.

These changes need to be applied to the ebuild:

diff -burN /usr/portage/net-wireless/hostapd/hostapd-2.6.ebuild /usr/local/portage/overlays/local/net-wireless/hostapd/hostapd-2.6.ebuild 
--- /usr/portage/net-wireless/hostapd/hostapd-2.6.ebuild        2016-10-14 19:01:21.000000000 +0200
+++ /usr/local/portage/overlays/local/net-wireless/hostapd/hostapd-2.6.ebuild   2016-10-06 15:45:08.063603715 +0200
@@ -30,6 +28,7 @@
 S="${S}/${PN}"
 
 src_prepare() {
+       cd "${S}/.."
        default
 
        sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \


Otherwise the ebuild will fail is a user-patch is used.

Please commit this change, so we finally can close this issue. Thanks.
Comment 15 Thomas Deutschmann (RETIRED) gentoo-dev 2016-11-23 21:20:13 UTC
@ cilly: No, you have to respin patches for any EAPI=6. From https://blogs.gentoo.org/mgorny/2015/11/13/the-ultimate-guide-to-eapi-6/:

> No -p* guessing. Instead, it defaults to -p1

There's nothing wrong with the hostapd ebuild. src_prepare() starts in the correct folder. Changing the CWD would be wrong.
Comment 16 cilly 2016-11-24 00:53:09 UTC
(In reply to Thomas Deutschmann from comment #15)
> @ cilly: No, you have to respin patches for any EAPI=6. From
> https://blogs.gentoo.org/mgorny/2015/11/13/the-ultimate-guide-to-eapi-6/:
> 
> > No -p* guessing. Instead, it defaults to -p1
> 
> There's nothing wrong with the hostapd ebuild. src_prepare() starts in the
> correct folder. Changing the CWD would be wrong.

Did you test it?
Comment 17 Thomas Deutschmann (RETIRED) gentoo-dev 2016-11-24 01:53:12 UTC
cilly was right. Users were unable to patch src/drivers for example:

> commit 0e0eafba82bba0fa9144acdcd97c1936a3b9d6ab
> Author: Thomas Deutschmann
> Date:   Thu Nov 24 02:49:49 2016 +0100
> 
>     net-wireless/hostapd: Allow users to apply patches to src/drivers
> 
>     Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=596306#c5
> 
>     Package-Manager: portage-2.3.2