Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 275910 - media-sound/alsa-utils-1.0.17: bad upgrade path to /etc/modprobe.d/alsa.conf
Summary: media-sound/alsa-utils-1.0.17: bad upgrade path to /etc/modprobe.d/alsa.conf
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo ALSA team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 274942
  Show dependency tree
 
Reported: 2009-06-30 09:05 UTC by Matthias Schwarzott
Modified: 2009-12-20 02:17 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 Matthias Schwarzott gentoo-dev 2009-06-30 09:05:56 UTC
The update to install modprobe-config file as /etc/modprobe.d/alsa.conf is not very user-friendly.

First the old code in pkg_preinst moves the very old file /etc/modules.d/alsa to /etc/modprobe.d/alsa and not /etc/modprobe.d/alsa.conf
Second there is no code to move /etc/modprobe.d/alsa to /etc/modprobe.d/alsa.conf

So when user has modified its file, then emerge will add new alsa.conf file and old will stay.

I suggest to add code for moving alsa to alsa.conf to pkg_preinst.
Comment 1 Ian Abbott 2009-07-09 11:44:58 UTC
A better pkg_preinst() function for the ebuilds, based on the way media-video/em8300-modules does it:

pkg_preinst() {
    linux-mod_pkg_preinst

    local old1="${ROOT}/etc/modprobe.d/alsa"
    local old2="${ROOT}/etc/modules.d/alsa"
    local new="${ROOT}/etc/modprobe.d/alsa.conf"

    if [[ ! -a ${new} ]]; then
        if [[ -a ${old1} ]]; then
            elog "Renaming /etc/modprobe.d/alsa to /etc/modprobe.d/alsa.conf"
            mv "${old1}" "${new}"
        elif [[ -a ${old2} ]]; then
            elog "Moving old alsa configuration in /etc/modules.d to new"
            elog "location in /etc/modprobe.d"
            mv "${old2}" "${new}"
        fi
    fi
}
Comment 2 Ian Abbott 2009-07-09 11:49:05 UTC
Please ignore the 'linux-mod_pkg_preinst' line in my previous comment.  Cut'n'paste error :)

pkg_preinst() {
    local old1="${ROOT}/etc/modprobe.d/alsa"
    local old2="${ROOT}/etc/modules.d/alsa"
    local new="${ROOT}/etc/modprobe.d/alsa.conf"

    if [[ ! -a ${new} ]]; then
        if [[ -a ${old1} ]]; then
            elog "Renaming /etc/modprobe.d/alsa to /etc/modprobe.d/alsa.conf"
            mv "${old1}" "${new}"
        elif [[ -a ${old2} ]]; then
            elog "Moving old alsa configuration in /etc/modules.d to new"
            elog "location in /etc/modprobe.d"
            mv "${old2}" "${new}"
        fi
    fi
}
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2009-08-04 14:50:32 UTC
1.0.20-r4 handles this... not in the proposed way, but it does
Comment 4 James 2009-08-05 01:45:02 UTC
Looks like this might not be completely resolved with 1.0.20-r4:

 * Obsolete config /etc/modules.d/alsa found.
 *
 * ERROR: media-sound/alsa-utils-1.0.20-r4 failed.
 * Call stack:
 *                     ebuild.sh, line   49:  Called pkg_setup
 *   alsa-utils-1.0.20-r4.ebuild, line   34:  Called die
 * The specific snippet of code:
 *              die "Move /etc/modules.d/alsa to /etc/modprobe.d/alsa.conf."
 *  The die message:
 *   Move /etc/modules.d/alsa to /etc/modprobe.d/alsa.conf.
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/media-sound/alsa-utils-1.0.20-r4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-sound/alsa-utils-1.0.20-r4/temp/die.env'.
 *

>>> Failed to emerge media-sound/alsa-utils-1.0.20-r4, Log file:
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2009-08-05 05:17:36 UTC
(In reply to comment #4)
> Looks like this might not be completely resolved with 1.0.20-r4:
>  *              die "Move /etc/modules.d/alsa to /etc/modprobe.d/alsa.conf."

Failed to read the message?
Comment 6 James 2009-08-05 19:29:56 UTC
(In reply to comment #5)
> (In reply to comment #4)
> 
> Failed to read the message?
> 

Looks like I did.  :)  This doesn't seem very user friendly, is there a reason why the ebuild does not do this?
Comment 7 Eric Siegel 2009-08-07 18:37:56 UTC
(In reply to comment #6)
> Looks like I did.  :)  This doesn't seem very user friendly, is there a reason
> why the ebuild does not do this?

The error message says "Move /etc/modules.d/alsa to /etc/modprobe.d/alsa.conf."  I thought that the ebuild had an error doing that, not that it wanted me to do that.  Why can't the ebuild just move the files by itself?
Comment 8 R Cangro 2009-12-20 02:17:03 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Looks like I did.  :)  This doesn't seem very user friendly, is there a reason
> > why the ebuild does not do this?
> 
> The error message says "Move /etc/modules.d/alsa to /etc/modprobe.d/alsa.conf."
>  I thought that the ebuild had an error doing that, not that it wanted me to do
> that.  Why can't the ebuild just move the files by itself?
> 

agreed. I thought the same thing when I saw the error. It wasn't until I googled for it and found this bug entry that I knew what was wrong. This is not user friendly and should be made so. Perhaps a new bug should be opened as a portage feature enhancement though,