]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_new.py
oops
[dak.git] / dak / process_new.py
index fc952d2a346d86ba60dc963e35aacb7c0f4c15d0..f11c7c0228013577e368d9a5b9c10c9efe21fdd6 100755 (executable)
@@ -333,43 +333,6 @@ def edit_overrides (new, upload, session):
 
     return new
 
-################################################################################
-
-def edit_note(note, upload, session):
-    # Write the current data to a temporary file
-    (fd, temp_filename) = utils.temp_filename()
-    editor = os.environ.get("EDITOR","vi")
-    answer = 'E'
-    while answer == 'E':
-        os.system("%s %s" % (editor, temp_filename))
-        temp_file = utils.open_file(temp_filename)
-        newnote = temp_file.read().rstrip()
-        temp_file.close()
-        print "New Note:"
-        print utils.prefix_multi_line_string(newnote,"  ")
-        prompt = "[D]one, Edit, Abandon, Quit ?"
-        answer = "XXX"
-        while prompt.find(answer) == -1:
-            answer = utils.our_raw_input(prompt)
-            m = re_default_answer.search(prompt)
-            if answer == "":
-                answer = m.group(1)
-            answer = answer[:1].upper()
-    os.unlink(temp_filename)
-    if answer == 'A':
-        return
-    elif answer == 'Q':
-        end()
-        sys.exit(0)
-
-    comment = NewComment()
-    comment.package = upload.pkg.changes["source"]
-    comment.version = upload.pkg.changes["version"]
-    comment.comment = newnote
-    comment.author  = utils.whoami()
-    comment.trainee = bool(Options["Trainee"])
-    session.add(comment)
-    session.commit()
 
 ################################################################################
 
@@ -448,57 +411,6 @@ def add_overrides (new, upload, session):
 
 ################################################################################
 
-def prod_maintainer (notes, upload):
-    cnf = Config()
-    # Here we prepare an editor and get them ready to prod...
-    (fd, temp_filename) = utils.temp_filename()
-    temp_file = os.fdopen(fd, 'w')
-    for note in notes:
-        temp_file.write(note.comment)
-    temp_file.close()
-    editor = os.environ.get("EDITOR","vi")
-    answer = 'E'
-    while answer == 'E':
-        os.system("%s %s" % (editor, temp_filename))
-        temp_fh = utils.open_file(temp_filename)
-        prod_message = "".join(temp_fh.readlines())
-        temp_fh.close()
-        print "Prod message:"
-        print utils.prefix_multi_line_string(prod_message,"  ",include_blank_lines=1)
-        prompt = "[P]rod, Edit, Abandon, Quit ?"
-        answer = "XXX"
-        while prompt.find(answer) == -1:
-            answer = utils.our_raw_input(prompt)
-            m = re_default_answer.search(prompt)
-            if answer == "":
-                answer = m.group(1)
-            answer = answer[:1].upper()
-    os.unlink(temp_filename)
-    if answer == 'A':
-        return
-    elif answer == 'Q':
-        end()
-        sys.exit(0)
-    # Otherwise, do the proding...
-    user_email_address = utils.whoami() + " <%s>" % (
-        cnf["Dinstall::MyAdminAddress"])
-
-    Subst = upload.Subst
-
-    Subst["__FROM_ADDRESS__"] = user_email_address
-    Subst["__PROD_MESSAGE__"] = prod_message
-    Subst["__CC__"] = "Cc: " + cnf["Dinstall::MyEmailAddress"]
-
-    prod_mail_message = utils.TemplateSubst(
-        Subst,cnf["Dir::Templates"]+"/process-new.prod")
-
-    # Send the prod mail
-    utils.send_mail(prod_mail_message)
-
-    print "Sent proding message"
-
-################################################################################
-
 def do_new(upload, session):
     print "NEW\n"
     files = upload.pkg.files
@@ -757,9 +669,13 @@ def do_pkg(changes_file, session):
                 if not recheck(u, session):
                     return
 
-                # FIXME: This does need byhand checks added!
-                new = determine_new(u.pkg.changes, files)
-                if new:
+                new, byhand = determine_new(u.pkg.changes, files)
+                if byhand:
+                    # TODO: Fix this and make sure it doesn't complain when we've
+                    #       got already processed byhand components
+                    print "Warning: This has byhand components and probably shouldn't be in NEW."
+                    print "Contact an ftpmaster as this needs to be dealt with by them"
+                elif new:
                     do_new(u, session)
                 else:
                     try: