summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Tropf <asymmail@googlemail.com>2009-06-05 20:29:18 +0200
committerBjoern Tropf <asymmail@googlemail.com>2009-06-05 20:29:18 +0200
commit7995ec88f74f10f6b64578a33d43eddbdd459669 (patch)
treef6d07b646ddc850d00049f980fb6123587f9201f
parentSome fixes to previous commit (diff)
downloadkernel-check-7995ec88f74f10f6b64578a33d43eddbdd459669.tar.gz
kernel-check-7995ec88f74f10f6b64578a33d43eddbdd459669.tar.bz2
kernel-check-7995ec88f74f10f6b64578a33d43eddbdd459669.zip
Implement get_genpatch()
-rw-r--r--TODO1
-rwxr-xr-xcollector.py11
-rwxr-xr-xkernel-check.py9
-rwxr-xr-xkernellib.py10
4 files changed, 24 insertions, 7 deletions
diff --git a/TODO b/TODO
index 669247a..1c2018a 100644
--- a/TODO
+++ b/TODO
@@ -2,6 +2,7 @@ Todo
====
- Fix all TODO markers
- Move is_in_interval to kernellib.py
+- Use dict instead of list for genpatches
Clean code
==========
diff --git a/collector.py b/collector.py
index d111a33..d5e9add 100755
--- a/collector.py
+++ b/collector.py
@@ -64,12 +64,17 @@ def main(argv):
if not os.path.isdir(folder[directory]):
os.makedirs(folder[directory])
- print('Reading available genpatches...')
- read_patches = lib.read_genpatch_file(folder['out'])
+
+ try:
+ print('Reading available genpatches...')
+ read_patches = lib.read_genpatch_file(folder['out'])
+ except:
+ read_patches = list()
+ pass
print('Parsing genpatches from portage...')
found_patches = lib.parse_genpatch_list(folder['tree'])
-
+
new_items = 0
for item in found_patches:
if item not in read_patches:
diff --git a/kernel-check.py b/kernel-check.py
index 12c95c6..e5de4d3 100755
--- a/kernel-check.py
+++ b/kernel-check.py
@@ -26,10 +26,11 @@ def main(argv):
'Main function'
KERNEL = lib.extract_version(os.uname()[2])
- GENPATCH = None
+
ARCH = os.uname()[4]
- CVE = [345, 284, 274, 0, 4] #TODO: Implement
BEST = lib.best_version(KERNEL['source'] + '-sources')
+ CVE = [345, 284, 274, 0, 4] #TODO: Implement
+ GENPATCH = lib.get_genpatch(lib.read_genpatch_file('out'), KERNEL)
info = portage.output.EOutput().einfo
warn = portage.output.EOutput().ewarn
@@ -65,12 +66,12 @@ def main(argv):
sys.exit()
if GENPATCH:
- info('Integrated genpatch: ' + GENPATCH['version'] + ' ' + GENPATCH['want'])
+ info('Integrated genpatch: ' + color('GOOD', GENPATCH[2] + ' ' + GENPATCH[3]))
else:
warn('No genpatch information found!')
if ARCH:
- info('System architecture: ' + ARCH)
+ info('System architecture: ' + color('GOOD', ARCH))
else:
error('No system architecture found!')
sys.exit()
diff --git a/kernellib.py b/kernellib.py
index 00044d2..af15004 100755
--- a/kernellib.py
+++ b/kernellib.py
@@ -216,6 +216,16 @@ def write_genpatch_file(directory, genpatches):
return
+def get_genpatch(patches, kernel):
+ #TODO: Description
+
+ for item in patches:
+ if kernel['source'] + '-sources' == item[0]:
+ if kernel['version'] + '_' + kernel['revision'] == item[1]:
+ return item
+
+ return None
+
def parse_bugzilla_list(filename):
'Returns a list containing all bugzilla kernel bugs'