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

Bug 392767

Summary: media-libs/mesa: Bad string substitution in mesa-7.11.2.ebuild (when doing a prefix build with 'dri' in pathname)
Product: Gentoo Linux Reporter: Duncan Forster <duncan.forster>
Component: New packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: prefix
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Duncan Forster 2011-12-02 00:06:17 UTC
Install phase of MESA build fails. 
A bad string substitution is the culprit, see below:

	src_install ()
	{
	...
		for x in "${ED}"/usr/$(get_libdir)/dri/*.so;
		do
		    if [ -f ${x} -o -L ${x} ]; then
			mv -f "${x}" "${x/dri/mesa}" || die "Failed to move ${x}";
		    fi;
		done;

This is mainly an issue with prefix builds were pathname contains 'dri'.

A slightly more correct version is: ${x/dri/mesa} --> ${x/\/dri\///mesa/}

Reproducible: Always

Steps to Reproduce:
1. Create prefix install with a pathname that contains 'dri', such as /edrive/gentoo
2. emerge media-libs/mesa

Actual Results:  
 * Moving DRI/Gallium drivers for dynamic switching ...
mv: cannot move `/edrive/gentoo/var/tmp/portage/media-libs/mesa-7.11.2/image/edrive/gentoo//usr/lib/dri/i810_dri.so' to `/emesave/gentoo/var/tmp/portage/media-libs/mesa-7.11.2/image/edrive/gentoo//usr/lib/dri/i810_dri.so': No such file or directory


Expected Results:  
The mv should work.

i.e.
	/edrive/gentoo/var/tmp/portage/media-libs/mesa-7.11.2/image/edrive/gentoo/usr/lib/dri/i810_dri.so
to
	/edrive/gentoo/var/tmp/portage/media-libs/mesa-7.11.2/image/edrive/gentoo/usr/lib/mesa/i810_dri.so
Comment 1 Chí-Thanh Christopher Nguyễn gentoo-dev 2011-12-04 00:33:52 UTC
Possible idea:

mv -f "${x}" "${x%dri*}mesa/"
Comment 2 Fabian Groffen gentoo-dev 2011-12-04 09:02:27 UTC
How about:

        pushd "${ED}"/usr/$(get_libdir)/dri > /dev/null || die
        for x in *$(get_libname);
        do
            if [ -f ${x} -o -L ${x} ]; then
                mv -f "${x}" ../mesa/ || die "Failed to move ${x}";
            fi;
        done;
        popd > /dev/null
Comment 3 Fabian Groffen gentoo-dev 2011-12-04 13:02:37 UTC
thinking about this, why not just

mv -f "${ED}"/usr/$(get_libdir)/dri/*$(get_libname) "${ED}"/usr/$(get_libdir)/mesa/

?
Comment 4 David Heidelberg (okias) 2013-05-26 10:04:20 UTC
Ducan, is this issue still valid?
Comment 5 Duncan Forster 2013-05-26 21:21:15 UTC
Yes, this is still a problem. Everytime mesa library is updated I hack the ebuild to make it work.
Comment 6 David Heidelberg (okias) 2014-01-12 16:06:56 UTC
@Duncan Forster
I see different code in gx86 now, can you recheck it's fixed?