Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 327549 - eutils.eclass: typo in cdrom_get_cds path check
Summary: eutils.eclass: typo in cdrom_get_cds path check
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2010-07-09 01:32 UTC by Jared B.
Modified: 2010-07-10 06:04 UTC (History)
1 user (show)

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


Attachments
cdrom_get_cds fix (eutils.eclass.patch,341 bytes, patch)
2010-07-09 01:33 UTC, Jared B.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jared B. 2010-07-09 01:32:35 UTC
The cdrom_get_cds() function improperly tests for the existence of a given file when determining which CD of a given set has been provided.  The problem is with this line:

@@ -1512,7 +1512,7 @@
 		export CDROM_SET=-1
 		for f in ${CDROM_CHECK_1//:/ } ; do
 			((++CDROM_SET))
-			[[ -e ${CD_ROOT}/${f} ]] && break
+			[[ -e ${CDROM_ROOT}/${f} ]] && break
 		done
 		export CDROM_MATCH=${f}
 		return

$CD_ROOT does not exist at that point, so it's checking for the presence of "/${f}", which, of course, fails.  It should instead check "${CDROM_ROOT}/${f}", which will work as expected.

Attached patch will fix the problem.

Please see also bug 195868.

Reproducible: Always

Steps to Reproduce:
Try to install an ebuild (such as Unreal Tournament in bug 134156) that:
1. copies from CD media
2. has multiple versions of the CD media
3. using $CD_ROOT[_n] to specify the location of the media

As described in bug 195868, this check will also fail in an unpredictable manner by returning the last option checked whether it or nothing was matched.
Actual Results:  
ebuild will fail stating the proper CD was not detected

Expected Results:  
ebuild should install
Comment 1 Jared B. 2010-07-09 01:33:04 UTC
Created attachment 238089 [details, diff]
cdrom_get_cds fix
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2010-07-10 06:04:38 UTC
Thanks for the find, Jared. Its now committed to the tree.