提交 69f4a78e 编写于 作者: J James Troup

more sorting fixeds and feedback when sorting large number of .changes

上级 2bed9bb8
......@@ -2,7 +2,7 @@
# Handles NEW and BYHAND packages
# Copyright (C) 2001, 2002 James Troup <james@nocrew.org>
# $Id: lisa,v 1.12 2002-05-19 02:00:48 troup Exp $
# $Id: lisa,v 1.13 2002-05-19 19:55:56 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -58,7 +58,7 @@ import apt_pkg, apt_inst;
import db_access, fernanda, katie, logging, utils;
# Globals
lisa_version = "$Revision: 1.12 $";
lisa_version = "$Revision: 1.13 $";
Cnf = None;
Options = None;
......@@ -141,25 +141,28 @@ def determine_new (changes, files):
def changes_compare (a, b):
try:
a_changes = utils.parse_changes(a);
Katie.pkg.changes_file = a;
Katie.init_vars();
Katie.update_vars();
a_changes = copy.copy(Katie.pkg.changes);
except:
return 1;
try:
b_changes = utils.parse_changes(b);
Katie.pkg.changes_file = b;
Katie.init_vars();
Katie.update_vars();
b_changes = copy.copy(Katie.pkg.changes);
except:
return -1;
utils.cc_fix_changes (a_changes);
utils.cc_fix_changes (b_changes);
# Sort by 'have note';
a_has_note = a_changes.get("lisa note");
b_has_note = b_changes.get("lisa note");
if a_has_note and not b_has_note:
return -1;
elif b_has_note and not a_has_note:
return 1;
elif b_has_note and not a_has_note:
return -1;
# Sort by 'have source'
a_has_source = a_changes["architecture"].get("source");
......@@ -795,6 +798,8 @@ def end():
def main():
changes_files = init();
if len(changes_files) > 50:
sys.stderr.write("Sorting changes...\n");
changes_files.sort(changes_compare);
# Kill me now? **FIXME**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册