From 3e08333903329240b0d8f23ff81adf308d366e01 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 3 Dec 2013 11:02:41 +0100 Subject: [PATCH] ckmake: sort kernel releases properly Ever since 3.10, kernel releases weren't sorted properly. Put them into a parsed list first and then sort them to get the 3.10/11/12 etc. to the bottom of the list. Signed-off-by: Johannes Berg Signed-off-by: Luis R. Rodriguez --- devel/ckmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/devel/ckmake b/devel/ckmake index 7c0ab5a0059a..8c440513f266 100755 --- a/devel/ckmake +++ b/devel/ckmake @@ -419,7 +419,7 @@ class kernel_set(): def parse_releases(self, target_kranges): self.target_kranges = target_kranges for dirname, dirnames, filenames in os.walk(modules): - dirnames.sort() + rels = [] for subdirname in dirnames: specifics = get_rel_spec_ubuntu(subdirname) if (not specifics): @@ -439,8 +439,7 @@ class kernel_set(): ver = ver + '.' + specifics['SUBLEVEL'] get_rel_spec_base(subdirname) - rel = dict(idx=len(self.releases), - name=subdirname, + rel = dict(name=subdirname, full_path=dirname + '/' + subdirname, version=ver, @@ -454,6 +453,12 @@ class kernel_set(): processed=False, log='', status=1234) + rels.append(rel) + def relsort(rel): + return int(rel['ver']), int(rel['pat']), int(rel['sub']) + rels.sort(key=relsort) + for rel in rels: + rel['idx'] = len(self.releases) self.evaluate_new_rel(rel) self.refresh() def setup_screen(self): -- 2.30.2