Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 24761 Details for
Bug 40099
ExtractKernelVersion relies on generated file include/linux/version.h
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to portage.py (from latest stable portage)
portage.py-KV-method-v2.diff (text/plain), 1.49 KB, created by
Peter Johanson (RETIRED)
on 2004-02-01 10:50:33 UTC
(
hide
)
Description:
patch to portage.py (from latest stable portage)
Filename:
MIME Type:
Creator:
Peter Johanson (RETIRED)
Created:
2004-02-01 10:50:33 UTC
Size:
1.49 KB
patch
obsolete
>--- portage.py.orig 2004-01-18 05:41:58.000000000 -0500 >+++ portage.py 2004-01-30 12:28:13.996729528 -0500 >@@ -922,30 +922,41 @@ > # version is None and error is a string > # > def ExtractKernelVersion(base_dir): >- pathname = os.path.join(base_dir, 'include/linux/version.h') >+ lines = [] >+ pathname = os.path.join(base_dir, 'Makefile') > try: >- lines = open(pathname, 'r').readlines() >+ f = open(pathname, 'r') > except OSError, details: > return (None, str(details)) > except IOError, details: > return (None, str(details)) > >+ try: >+ for i in range(4): >+ lines.append(f.readline()) >+ except OSError, details: >+ return (None, str(details)) >+ except IOError, details: >+ return (None, str(details)) >+ > lines = map(string.strip, lines) > > version = '' > > for line in lines: >- items = string.split(line, ' ', 2) >- if items[0] == '#define' and \ >- items[1] == 'UTS_RELEASE': >- version = items[2] # - may be wrapped in quotes >- break >- >- if version == '': >- return (None, "Unable to locate UTS_RELEASE in %s" % (pathname)) >+ # split on the '=' then remove annoying whitespace >+ items = string.split(line, '=') >+ items = map(string.strip, items) >+ if items[0] == 'VERSION' or \ >+ items[0] == 'PATCHLEVEL': >+ version += items[1] >+ version += "." >+ elif items[0] == 'SUBLEVEL': >+ version += items[1] >+ elif items[0] == 'EXTRAVERSION' and \ >+ items[-1] != items[0]: >+ version += items[1] > >- if version[0] == '"' and version[-1] == '"': >- version = version[1:-1] > return (version,None) > > aumtime=0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 40099
: 24761