X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lisa;h=22341b849751f19ac14b5a2c60fd955e68565532;hb=69f4a78e5ed8774bcb8dad17fc8f17d54971bfde;hp=7fae30625418e987f35efe478785d1093990d9d8;hpb=44f6878bd9cedddc46ddfabfc1e8660de1f32445;p=dak.git diff --git a/lisa b/lisa index 7fae3062..22341b84 100755 --- a/lisa +++ b/lisa @@ -2,7 +2,7 @@ # Handles NEW and BYHAND packages # Copyright (C) 2001, 2002 James Troup -# $Id: lisa,v 1.11 2002-05-18 23:55:07 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.11 $"; +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"); @@ -169,16 +172,17 @@ def changes_compare (a, b): elif b_has_source and not a_has_source: return 1; - # Sort by ctime - a_ctime = os.stat(a)[stat.ST_CTIME]; - b_ctime = os.stat(b)[stat.ST_CTIME]; - q = cmp (a_ctime, b_ctime); - if q: - return -q; - - # Sort by source name + # Sort by ctime-per-source a_source = a_changes.get("source"); b_source = b_changes.get("source"); + if a_source != b_source: + a_ctime = os.stat(a)[stat.ST_CTIME]; + b_ctime = os.stat(b)[stat.ST_CTIME]; + q = cmp (a_ctime, b_ctime); + if q: + return q; + + # Sort by source name q = cmp (a_source, b_source); if q: return q; @@ -188,7 +192,7 @@ def changes_compare (a, b): b_version = b_changes.get("version"); q = apt_pkg.VersionCompare(a_version, b_version); if q: - return q; + return -q; # Fall back to sort by filename return cmp(a, b); @@ -598,13 +602,15 @@ def do_new(): (broken, note) = print_new(new, 0); prompt = ""; - if not broken: + + if not broken and not note: prompt = "Add overrides, "; - else: + if broken: print "W: [!] marked entries must be fixed before package can be processed."; if note: print "W: note must be removed before package can be processed."; prompt = prompt + "Remove note, "; + prompt = prompt + "Edit overrides, Check, Manual reject, Note edit, [S]kip, Quit ?"; while string.find(prompt, answer) == -1: @@ -792,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**