Summary: | cdrom.eclass: cdrom_get_cds sets CDROM_SET and CDROM_MATCH incorrectly when the check fails | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | James Le Cuirot <chewi> |
Component: | Eclasses | Assignee: | Gentoo Games <games> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | daniel.santos, nitro |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
James Le Cuirot
![]() err, how ? cdrom_load_next_cd should not return until the file is matched ... the only way out of the infinite loop is for either the user to abort or the file to be found ... Heh I was trying to explain it so carefully that I forgot the crucial detail. It happens when CDROM_ROOT is given explicitly. A separate bit of code is used for that case. Check the cdrom_get_cds function where it says "now we see if the user gave use CD_ROOT ..." I've encountered this problem as well. I believe the problem is in this logic (begins on line 1513 in eutils.eclass from 07/08/2010): for f in ${CDROM_CHECK_1//:/ } ; do ((++CDROM_SET)) [[ -e ${CD_ROOT}/${f} ]] && break done export CDROM_MATCH=${f} return It will return the last file searched and found, or the last file search if nothing was found. Instead, I think something like this would be more appropriate: for f in ${CDROM_CHECK_1//:/ } ; do ((++CDROM_SET)) if [[ -e ${CD_ROOT}/${f} ]]; then export CDROM_MATCH=${f} return fi done return I'm not supplying an actual patch because I don't know what the expected behavior should be (I don't know how this ties in to ${CDROM_SET}, for example, which is where I see the problem on the ebuild side). For example, maybe adding CDROM_MATCH='' or unset CDROM_MATCH would be more appropriate above the second return. Either way, though, I can definitely confirm the bug. Please also see bug 327549 for another, but I believe separate, issue in that block of code. Heh I just ran into this again. I guess I should fix it now that I'm on the team! I was going to take Jared's approach but I notice that the non-CD_ROOT case uses "find -iname" instead of [[ -e ]] so it benefits from being case-insensitive. This would be handy for the CD_ROOT case too so I'll look at reworking it. *** Bug 342269 has been marked as a duplicate of this bug. *** *** Bug 373073 has been marked as a duplicate of this bug. *** I ended up practically rewriting the eclass. The logic is now simpler and more consistent so this is no longer an issue. |