]> git.decadent.org.uk Git - dak.git/blobdiff - lisa
handle orig.tar.gz already in the archive in NEW.
[dak.git] / lisa
diff --git a/lisa b/lisa
index e81ea710a16878c980a728afafe3097442eea86b..1467b0e9a29354bf18145566f426bf132ccfd87e 100755 (executable)
--- a/lisa
+++ b/lisa
@@ -1,8 +1,8 @@
 #!/usr/bin/env python
 
 # Handles NEW and BYHAND packages
-# Copyright (C) 2001, 2002  James Troup <james@nocrew.org>
-# $Id: lisa,v 1.18 2002-10-16 02:47:32 troup Exp $
+# Copyright (C) 2001, 2002, 2003  James Troup <james@nocrew.org>
+# $Id: lisa,v 1.26 2003-11-17 17:59:26 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
@@ -42,7 +42,7 @@ import apt_pkg, apt_inst;
 import db_access, fernanda, katie, logging, utils;
 
 # Globals
-lisa_version = "$Revision: 1.18 $";
+lisa_version = "$Revision: 1.26 $";
 
 Cnf = None;
 Options = None;
@@ -70,12 +70,16 @@ def recheck():
     reject_message = "";
 
     for file in files.keys():
+        # The .orig.tar.gz can disappear out from under us is it's a
+        # duplicate of one in the archive.
+        if not files.has_key(file):
+            continue;
         # Check that the source still exists
         if files[file]["type"] == "deb":
             source_version = files[file]["source version"];
             source_package = files[file]["source package"];
             if not Katie.pkg.changes["architecture"].has_key("source") \
-               and not Katie.source_exists(source_package, source_version):
+               and not Katie.source_exists(source_package, source_version, Katie.pkg.changes["distribution"].keys()):
                 source_epochless_version = utils.re_no_epoch.sub('', source_version);
                 dsc_filename = "%s_%s.dsc" % (source_package, source_epochless_version);
                 if not os.path.exists(Cnf["Dir::Queue::Accepted"] + '/' + dsc_filename):
@@ -172,6 +176,8 @@ def determine_new (changes, files):
 
     if changes["suite"].has_key("stable"):
         print "WARNING: overrides will be added for stable!";
+    if changes["suite"].has_key("oldstable"):
+        print "WARNING: overrides will be added for OLDstable!";
     for pkg in new.keys():
         if new[pkg].has_key("othercomponents"):
             print "WARNING: %s already present in %s distribution." % (pkg, new[pkg]["othercomponents"]);
@@ -512,13 +518,14 @@ def edit_overrides (new):
         got_answer = 0
         while not got_answer:
             answer = utils.our_raw_input(prompt);
-            answer = answer[:1].upper();
+            if not utils.str_isnum(answer):
+                answer = answer[:1].upper();
             if answer == "E" or answer == "D":
                 got_answer = 1;
             elif katie.re_isanum.match (answer):
                 answer = int(answer);
                 if (answer < 1) or (answer > index):
-                    print "%s is not a valid index (%s).  Please retry." % (index_range(index), answer);
+                    print "%s is not a valid index (%s).  Please retry." % (answer, index_range(index));
                 else:
                     got_answer = 1;
 
@@ -570,7 +577,7 @@ def edit_note(note):
 
 def check_pkg ():
     try:
-        less_fd = os.popen("less -", 'w', 0);
+        less_fd = os.popen("less -R -", 'w', 0);
         stdout_fd = sys.stdout;
         try:
             sys.stdout = less_fd;
@@ -610,7 +617,7 @@ def do_bxa_notification():
             summary += "Description: %s\n" % (control.Find("Description"));
     Katie.Subst["__BINARY_DESCRIPTIONS__"] = summary;
     bxa_mail = utils.TemplateSubst(Katie.Subst,Cnf["Dir::Templates"]+"/lisa.bxa_notification");
-    utils.send_mail(bxa_mail,"");
+    utils.send_mail(bxa_mail);
 
 ################################################################################
 
@@ -879,7 +886,7 @@ def main():
 
     # Kill me now? **FIXME**
     Cnf["Dinstall::Options::No-Mail"] = "";
-    bcc = "X-Katie: %s" % (lisa_version);
+    bcc = "X-Katie: lisa %s" % (lisa_version);
     if Cnf.has_key("Dinstall::Bcc"):
         Katie.Subst["__BCC__"] = bcc + "\nBcc: %s" % (Cnf["Dinstall::Bcc"]);
     else: