Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 370569 - net-wireless/bluez-4.91 installs /var/lib/misc/oui.txt as a symlink to /usr/portage/distfiles/
Summary: net-wireless/bluez-4.91 installs /var/lib/misc/oui.txt as a symlink to /usr/p...
Status: VERIFIED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 358927
  Show dependency tree
 
Reported: 2011-06-07 22:33 UTC by Faustus
Modified: 2011-07-03 09:07 UTC (History)
1 user (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 Faustus 2011-06-07 22:33:32 UTC
net-wireless/bluez ebuilds starting with 4.91 have a bug. Apparently, since EAPI 4, newins and doins preserve symlinks. The file oui.txt is installed as follows:

    insinto /var/lib/misc
    newins "${DISTDIR}/oui-${OUIDATE}.txt" oui.txt

However, "${DISTDIR}/oui-${OUIDATE}.txt" is a symlink: /var/tmp/portage/net-wireless/bluez-4.91/distdir/oui-20110330.txt -> /usr/portage/distfiles/oui-20110330.txt

So the symlink itself is copied, and the result is /var/lib/misc/oui.txt -> /usr/portage/distfiles/oui-20110330.txt
Comment 1 Pacho Ramos gentoo-dev 2011-06-08 10:34:22 UTC
Installed file is ok for me:

# ls -l /var/lib/misc/oui.txt
-rw-r--r-- 1 root root 2372550 jun  8 12:32 /var/lib/misc/oui.txt
Comment 2 Faustus 2011-06-08 13:34:40 UTC
Maybe it depends on portage version; mine is latest stable - 2.1.9.42.
Comment 3 Faustus 2011-06-08 14:27:41 UTC
/usr/lib/portage/bin/ebuild-helpers/doins:

case "$EAPI" in
    0|1|2|3|3_pre2)
        PRESERVE_SYMLINKS=n
        ;;
    *)
        PRESERVE_SYMLINKS=y
        ;;
esac


    if [ -L "$mysrc" ] ; then
        if [ $PRESERVE_SYMLINKS = y ] ; then
            rm -rf "$D$INSDESTTREE/$mydir/${mysrc##*/}" || return $?
            cp -P "$mysrc" "$D$INSDESTTREE/$mydir/${mysrc##*/}"
            return $?
        else


/usr/lib/portage/bin/ebuild-helpers/newins:

case "$EAPI" in
    0|1|2|3|3_pre2)
        cp "$1" "$T/$2" || exit $?
        ;;
    *)
        cp -P "$1" "$T/$2"
Comment 4 Pacho Ramos gentoo-dev 2011-06-08 17:39:21 UTC
I cannot reproduce this with sys-apps/portage-2.1.9.50
Comment 6 Pacho Ramos gentoo-dev 2011-06-08 17:50:52 UTC
When will a fixed portage version hit stable to prevent issues like this? Thanks :-)
Comment 7 Faustus 2011-06-08 17:53:57 UTC
(In reply to comment #5)
> This is fixed since portage-2.1.9.46:
Great - I was searching in vain for a relevant bug in the depends list of #358927.
Comment 8 Zac Medico gentoo-dev 2011-06-08 17:58:09 UTC
(In reply to comment #6)
> When will a fixed portage version hit stable to prevent issues like this?
> Thanks :-)

The plan is for portage-2.1.10 to be stabilized in approximately 30 days.
Comment 9 Faustus 2011-06-08 18:02:12 UTC
(In reply to comment #6)
> When will a fixed portage version hit stable to prevent issues like this?

Maybe it's easier to downgrade the required EAPI to 3 in the meanwhile? "diff /usr/portage/net-wireless/bluez/bluez-4.{87,91}.ebuild" doesn't seem to show anything EAPI 4-specific.

As it stands, installing bluez on a stable system produces incorrect results. Some users regularly purge /usr/portage/distfiles.
Comment 10 Pacho Ramos gentoo-dev 2011-06-08 18:19:48 UTC
Or maybe install that file with "cp" instead of "newins" until this is solved in stable... not sure how to proceed as this wrong portage behavior is probably causing more problems like this (that will need a recompilation to get solved!) for any other packages using this :-/

Couldn't portage team release a new portage version fixing only this bug and fast-stabilize it?
Comment 11 Zac Medico gentoo-dev 2011-06-08 18:25:35 UTC
(In reply to comment #9)
> Maybe it's easier to downgrade the required EAPI to 3 in the meanwhile? "diff
> /usr/portage/net-wireless/bluez/bluez-4.{87,91}.ebuild" doesn't seem to show
> anything EAPI 4-specific.

Alternatively, de-reference the symlink manually. It seems that the bluez-4.93 ebuild is already doing this since it unpacks oui-${OUIDATE}.txt.xz into $WORKDIR and then installs the txt file from there.

(In reply to comment #10)
> Or maybe install that file with "cp" instead of "newins" until this is solved
> in stable... not sure how to proceed as this wrong portage behavior is probably
> causing more problems like this (that will need a recompilation to get solved!)
> for any other packages using this :-/

Well, you could just stabilize bluez-4.93 since it's already been in the tree for more than 30 days.

> Couldn't portage team release a new portage version fixing only this bug and
> fast-stabilize it?

Well, it doesn't seem worth the trouble given that it doesn't affect many ebuilds and there's an easy workaround.
Comment 12 Pacho Ramos gentoo-dev 2011-06-08 18:26:59 UTC
(In reply to comment #0)
[...]
>     insinto /var/lib/misc
>     newins "${DISTDIR}/oui-${OUIDATE}.txt" oui.txt
[...]

Can you check if using "WORKDIR" instead of "DISTDIR" improves the situation?
Comment 13 Pacho Ramos gentoo-dev 2011-06-08 18:28:25 UTC
(In reply to comment #11)

> Well, you could just stabilize bluez-4.93 since it's already been in the tree
> for more than 30 days.
> 

It's true, for some reason I though I added it more recently ;), will go for this solution then
Comment 14 Zac Medico gentoo-dev 2011-06-08 18:29:08 UTC
(In reply to comment #12)
> (In reply to comment #0)
> [...]
> >     insinto /var/lib/misc
> >     newins "${DISTDIR}/oui-${OUIDATE}.txt" oui.txt
> [...]
> 
> Can you check if using "WORKDIR" instead of "DISTDIR" improves the situation?

You'd have to add something like this:

  cp "${DISTDIR}/oui-${OUIDATE}.txt" "${WORKDIR}/oui-${OUIDATE}.txt"

It's not necessary in the bluez-4.93 ebuild since it's compressed to a txt.xz file and unpack() automatically unpacks that into $WORKDIR.
Comment 15 Faustus 2011-06-10 11:59:29 UTC
Well, the bug is not fixed after all ATM - oui.txt installs as a symlink on a stable system.
Comment 16 Faustus 2011-06-10 12:09:53 UTC
(In reply to comment #12)
> Can you check if using "WORKDIR" instead of "DISTDIR" improves the situation?

This works:

    cp "${DISTDIR}/oui-${OUIDATE}.txt" "${WORKDIR}/oui-${OUIDATE}.txt"
    newins "${WORKDIR}/oui-${OUIDATE}.txt" oui.txt
Comment 17 Faustus 2011-07-03 09:07:53 UTC
bluez-4.93 is now stable for the same archs that bluez-4.91 is stable, so this bug is no more relevant.