]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_new.py
oops
[dak.git] / dak / process_new.py
index 5a88ffcfab435fd1bb281b0e3d625044870caf16..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()
 
 ################################################################################
 
@@ -380,17 +343,17 @@ def check_pkg (upload):
         try:
             sys.stdout = less_fd
             changes = utils.parse_changes (upload.pkg.changes_file)
-            examine_package.display_changes(changes['distribution'], upload.pkg.changes_file)
+            print examine_package.display_changes(changes['distribution'], upload.pkg.changes_file)
             files = upload.pkg.files
             for f in files.keys():
                 if files[f].has_key("new"):
                     ftype = files[f]["type"]
                     if ftype == "deb":
-                        examine_package.check_deb(changes['distribution'], f)
+                        print examine_package.check_deb(changes['distribution'], f)
                     elif ftype == "dsc":
-                        examine_package.check_dsc(changes['distribution'], f)
+                        print examine_package.check_dsc(changes['distribution'], f)
         finally:
-            examine_package.output_package_relations()
+            print examine_package.output_package_relations()
             sys.stdout = stdout_fd
     except IOError, e:
         if e.errno == errno.EPIPE:
@@ -448,58 +411,6 @@ def add_overrides (new, upload, session):
 
 ################################################################################
 
-def prod_maintainer (note, 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')
-    if len(note) > 0:
-        for line in note:
-            temp_file.write(line)
-    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
@@ -758,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:
@@ -769,21 +684,7 @@ def do_pkg(changes_file, session):
                     except CantGetLockError:
                         print "Hello? Operator! Give me the number for 911!"
                         print "Dinstall in the locked area, cant process packages, come back later"
-#             (new, byhand) = check_status(files)
-#             if new or byhand:
-#                 if new:
-#                     do_new(u, session)
-#                 if byhand:
-#                     do_byhand(u, session)
-#                 (new, byhand) = check_status(files)
-
-#             if not new and not byhand:
-#                 try:
-#                     check_daily_lock()
-#                     do_accept(u)
-#                 except CantGetLockError:
-#                     print "Hello? Operator! Give me the number for 911!"
-#                     print "Dinstall in the locked area, cant process packages, come back later"
+
     except AlreadyLockedError, e:
         print "Seems to be locked by %s already, skipping..." % (e)