Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 455808 - net-wireless/iw - src_install(): PREFIX="${EROOT}/usr" should be PREFIX="${EPREFIX}/usr
Summary: net-wireless/iw - src_install(): PREFIX="${EROOT}/usr" should be PREFIX="${EP...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Rick Farina (Zero_Chaos)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-02-06 08:52 UTC by Hristo Venev
Modified: 2013-02-08 16:07 UTC (History)
2 users (show)

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


Attachments
Make iw install in the proper location. (iw.patch,219 bytes, patch)
2013-02-08 15:44 UTC, Hristo Venev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hristo Venev 2013-02-06 08:52:32 UTC
src_install should not 'make PREFIX="${EROOT}/usr" install' because ${ROOT} is not a part of the prefix. It should 'make PREFIX="${EPREFIX}/usr" install' because EPREFIX is in fact the prefix.

Reproducible: Always
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2013-02-07 05:49:26 UTC
The variable ${ROOT} has for the same purpose a corresponding ${EROOT} which contains ${ROOT}${EPREFIX}. Often when ${ROOT} is being used, this can be replaced by ${EROOT} to add Gentoo Prefix support.

According to the prefix docs it is fine, care to enlighten me as to why this is wrong?  Output from portage claiming a violation should be easy enough to come by...
Comment 2 Hristo Venev 2013-02-07 21:50:40 UTC
The iw Makefile writes files in $(DESTDIR)$(PREFIX). Example:
DESTDIR is ${D}
PREFIX is ${EROOT} == ${ROOT}${EPREFIX}

Binaries are installed in ${D}${EROOT} == ${D}${ROOT}${EPREFIX}
Portage copies them to ${ROOT}${ROOT}${EPREFIX}. Double ${ROOT}. NOT THAT OF A GREAT IDEA.

Suppose PREFIX=${EPREFIX}

Binaries are installed in ${D}${EPREFIX}
Portage copies them to ${ROOT}${EPREFIX}. Isn't that what's expected to happen?

Please test all ebuilds with ${ROOT}!="". Or maybe even also with ${EPREFIX}!="".
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2013-02-07 23:27:44 UTC
> Please test all ebuilds with ${ROOT}!="". Or maybe even also with
> ${EPREFIX}!="".

Fair request.  I tested the ebuild as is in a prefix (despite the hardmask).  I found that not only was there no warnings from prefix portage about things being installed outside of the prefix, but the binaries were properly installed in ${EPREFIX}/usr
Comment 4 Hristo Venev 2013-02-08 08:15:11 UTC
${ROOT}!="" -> fail.

Tested and there is double ${ROOT}. There is NO way for it to work for anybody with ${ROOT}!="". Oh and I said test with ${ROOT}!="" and maybe ALSO with ${EPREFIX}!="". This means ${ROOT}!=""&&${EPREFIX}!="". ${ROOT}!="".

Please don't mark obviously broken stuff with WORKSFORME. OK? ${ROOT}!="" -> fail.

If you didn't read this, ${ROOT}!="" -> fail.
Comment 5 Rick Farina (Zero_Chaos) gentoo-dev 2013-02-08 14:12:18 UTC
(In reply to comment #4)
> ${ROOT}!="" -> fail.
> 
> Tested and there is double ${ROOT}. There is NO way for it to work for
> anybody with ${ROOT}!="". Oh and I said test with ${ROOT}!="" and maybe ALSO
> with ${EPREFIX}!="". This means ${ROOT}!=""&&${EPREFIX}!="". ${ROOT}!="".
> 
> Please don't mark obviously broken stuff with WORKSFORME. OK? ${ROOT}!="" ->
> fail.
> 
> If you didn't read this, ${ROOT}!="" -> fail.

You want the bug open, keep the bug open. You want me to fix it? Provide the errors for portage so I can see what you want fixed. This is tested and working for me, don't know what you need fixed.

>>> Installing (2 of 2) net-wireless/iw-3.8 to /tmp/
 * checking 3 files for package collisions
>>> Merging net-wireless/iw-3.8 to /tmp/
--- /tmp/usr/
--- /tmp/usr/lib/
--- /tmp/usr/lib/debug/
>>> /tmp/usr/lib/debug/tmp/
>>> /tmp/usr/lib/debug/tmp/usr/
>>> /tmp/usr/lib/debug/tmp/usr/sbin/
>>> /tmp/usr/lib/debug/tmp/usr/sbin/iw.debug
--- /tmp/tmp/
>>> /tmp/tmp/usr/
>>> /tmp/tmp/usr/sbin/
>>> /tmp/tmp/usr/sbin/iw
>>> /tmp/tmp/usr/share/
>>> /tmp/tmp/usr/share/man/
>>> /tmp/tmp/usr/share/man/man8/
>>> /tmp/tmp/usr/share/man/man8/iw.8.gz
>>> net-wireless/iw-3.8 merged.
>>> Regenerating /tmp/etc/ld.so.cache...
>>> Auto-cleaning packages...
Comment 6 Hristo Venev 2013-02-08 15:40:04 UTC
In your test case the binary gets installed in /tmp/tmp/usr/sbin/iw. /tmp appears twice. That's not expected to be there. Here is my test case:

ROOT=/THIS_SHOULD_APPEAR_ONCE emerge iw
....
>>> Installing (1 of 1) net-wireless/iw-3.8 to /THIS_SHOULD_APPEAR_ONCE/
 * checking 2 files for package collisions
>>> Merging net-wireless/iw-3.8 to /THIS_SHOULD_APPEAR_ONCE/
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/sbin/
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/sbin/iw
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/man/
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/man/man8/
>>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/man/man8/iw.8.gz

THIS_SHOULD_APPEAR_ONCE appears twice.
Comment 7 Hristo Venev 2013-02-08 15:44:38 UTC
Created attachment 338324 [details, diff]
Make iw install in the proper location.

This way the package is installed in ${EROOT}==${ROOT}${EPREFIX} instead of ${ROOT}${EROOT}==${ROOT}${ROOT}${EPREFIX}.
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2013-02-08 16:07:38 UTC
(In reply to comment #6)
> In your test case the binary gets installed in /tmp/tmp/usr/sbin/iw. /tmp
> appears twice. That's not expected to be there. Here is my test case:
> 
> ROOT=/THIS_SHOULD_APPEAR_ONCE emerge iw
> ....
> >>> Installing (1 of 1) net-wireless/iw-3.8 to /THIS_SHOULD_APPEAR_ONCE/
>  * checking 2 files for package collisions
> >>> Merging net-wireless/iw-3.8 to /THIS_SHOULD_APPEAR_ONCE/
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/sbin/
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/sbin/iw
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/man/
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/man/man8/
> >>> /THIS_SHOULD_APPEAR_ONCE/THIS_SHOULD_APPEAR_ONCE/usr/share/man/man8/iw.8.gz
> 
> THIS_SHOULD_APPEAR_ONCE appears twice.

Confirmed, tested, fixed. Thanks, sometimes you have to beat me over the head with things, especially when they aren't officially supported (open tracker on ROOT= still) and there are no QA checks at all for them.

+  08 Feb 2013; Rick Farina <zerochaos@gentoo.org> iw-3.7.ebuild, iw-3.8.ebuild:
+  fix installation when ROOT!=/ wrt bug 455808