Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 98721 - Bad localversion handling in linux-info.eclass leading to wrong installation path
Summary: Bad localversion handling in linux-info.eclass leading to wrong installation ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal
Assignee: John Mylchreest (RETIRED)
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2005-07-11 17:47 UTC by BlaisorBlade
Modified: 2005-07-14 12:34 UTC (History)
0 users

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


Attachments
Patch to fix the problem (fix-localver-handling.patch,2.35 KB, patch)
2005-07-11 17:50 UTC, BlaisorBlade
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BlaisorBlade 2005-07-11 17:47:58 UTC
The kernel version is determined, beyond that from the Makefile, from 
localversion* files found in the source tree root. But actually, files ending in 
~ and files with ~ in the middle are excluded (look at 2.6.11). And linux-info 
does not handle this, so we get problems.

Also, it does not handle at all the existance of two localversion files, because 
their contents are not joined but are left separated by newlines.

Attached patch should fix it. Tested both with and without localversion files.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 BlaisorBlade 2005-07-11 17:50:34 UTC
Created attachment 63188 [details, diff]
Patch to fix the problem

This is the patch I referred to above.
Comment 2 BlaisorBlade 2005-07-11 17:51:18 UTC
Forgot to say: this causes modules to be installed in the wrong place, and 
depmod to fail when called.
Comment 3 John Mylchreest (RETIRED) gentoo-dev 2005-07-14 12:33:50 UTC
Thanks for noticing this.
I have updated the eclass with smething very similar to your patch. However, it
is completely bash, and looks like:

get_localversion() {
	local lv_list i x

	# ignore files with ~ in it.
	for i in $(ls ${1}/localversion* 2>/dev/null); do
		[[ -n ${i//*~*} ]] && lv_list="${lv_list} ${i}"
	done

	for i in ${lv_list}; do
		x="${x}$(<${i})"
	done
	x=${x/ /}
	echo ${x}
}

Should be fixed in cvs. please emerge sync in about an hour and try again.
Thanks. Any problems log here :)
Comment 4 John Mylchreest (RETIRED) gentoo-dev 2005-07-14 12:34:11 UTC
closing