X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lisa;h=a31cc2445e1b531c5bfd22218dd17d4a46779cb2;hb=73299e3d3d571ea12e5a08248420b8f93340cc0b;hp=7d600f1da72831f0738249d844c1cfc6e687bb8d;hpb=e38ec49727ef15c6dcad16f7ebdb56e8e254d568;p=dak.git diff --git a/lisa b/lisa index 7d600f1d..a31cc244 100755 --- a/lisa +++ b/lisa @@ -2,7 +2,7 @@ # Handles NEW and BYHAND packages # Copyright (C) 2001 James Troup -# $Id: lisa,v 1.1 2002-02-12 23:08:07 troup Exp $ +# $Id: lisa,v 1.4 2002-02-22 02:20:06 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.1 $"; +lisa_version = "$Revision: 1.4 $"; Cnf = None; Options = None; @@ -85,6 +85,9 @@ def determine_new (changes, files): pkg = f["package"]; priority = f["priority"]; section = f["section"]; + # FIXME: unhardcode + if section == "non-US/main": + section = "non-US"; type = get_type(f); component = f["component"]; @@ -107,6 +110,8 @@ def determine_new (changes, files): new[pkg]["type"] = type; new[pkg]["component"] = component; new[pkg]["files"].append(file); + if f.has_key("othercomponents"): + new[pkg]["othercomponents"] = f["othercomponents"]; for suite in changes["distribution"].keys(): suite_id = db_access.get_suite_id(suite); @@ -121,6 +126,12 @@ def determine_new (changes, files): del files[file]["new"]; del new[pkg]; + if changes["distribution"].has_key("stable"): + print "WARNING: overrides will be added for stable!"; + for pkg in new.keys(): + if new[pkg].has_key("othercomponents"): + print "WARNING: %s already present in %s distribution." % (pkg, new[pkg]["othercomponents"]); + return new; ################################################################################ @@ -131,12 +142,12 @@ def changes_compare_by_time (a, b): try: a_changes = utils.parse_changes(a, 0) except: - return -1; + return 1; try: b_changes = utils.parse_changes(b, 0) except: - return 1; + return -1; utils.cc_fix_changes (a_changes); utils.cc_fix_changes (b_changes); @@ -345,7 +356,7 @@ def edit_index (new, index): edit_priority = edit_section = 0; while string.find(prompt, answer) == -1: - answer = raw_input(prompt); + answer = utils.our_raw_input(prompt); m = katie.re_default_answer.match(prompt) if answer == "": answer = m.group(1) @@ -365,7 +376,7 @@ def edit_index (new, index): readline.set_completer(Priorities.complete); got_priority = 0; while not got_priority: - new_priority = string.strip(raw_input("New priority: ")); + new_priority = string.strip(utils.our_raw_input("New priority: ")); if Priorities.priorities.count(new_priority) == 0: print "E: '%s' is not a valid priority, try again." % (new_priority); else: @@ -377,7 +388,7 @@ def edit_index (new, index): readline.set_completer(Sections.complete); got_section = 0; while not got_section: - new_section = string.strip(raw_input("New section: ")); + new_section = string.strip(utils.our_raw_input("New section: ")); if Sections.sections.count(new_section) == 0: print "E: '%s' is not a valid section, try again." % (new_section); else: @@ -411,8 +422,8 @@ def edit_overrides (new): got_answer = 0 while not got_answer: - answer = raw_input(prompt) - answer = string.upper(answer[:1]) + answer = utils.our_raw_input(prompt); + answer = string.upper(answer[:1]); if answer == "E" or answer == "D": got_answer = 1; elif katie.re_isanum.match (answer): @@ -532,23 +543,21 @@ def do_new(): answer = "XXX"; if Options["No-Action"] or Options["Automatic"]: - answer = 'S' - if Options["Automatic"]: - answer = 'A'; + answer = 'S'; broken = print_new(new, 0); prompt = ""; if not broken: - prompt = "[A]dd overrides, "; + prompt = "Add overrides, "; else: print "W: [!] marked entries must be fixed before package can be processed."; if answer == 'A': answer = 'E'; - prompt = prompt + "Edit overrides, Check, Manual reject, Skip, Quit ?"; + prompt = prompt + "Edit overrides, Check, Manual reject, [S]kip, Quit ?"; while string.find(prompt, answer) == -1: - answer = raw_input(prompt) - m = katie.re_default_answer.match(prompt) + answer = utils.our_raw_input(prompt); + m = katie.re_default_answer.search(prompt); if answer == "": answer = m.group(1) answer = string.upper(answer[:1]) @@ -656,11 +665,11 @@ def do_byhand(): prompt = "Manual reject, [S]kip, Quit ?"; while string.find(prompt, answer) == -1: - answer = raw_input(prompt) - m = katie.re_default_answer.match(prompt) + answer = utils.our_raw_input(prompt); + m = katie.re_default_answer.search(prompt); if answer == "": - answer = m.group(1) - answer = string.upper(answer[:1]) + answer = m.group(1); + answer = string.upper(answer[:1]); if answer == 'A': done = 1;