X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_policy.py;h=dfe538fb127be7b9a556f919fcd72740468da1bb;hb=cc8c39a7a9d895a5662c73f225318d74995bec92;hp=83ee19b55df3232b426eacd997c31c4a4cc3e8bb;hpb=d9daaa0b74845853a09b34cd930f6f2879bc1254;p=dak.git diff --git a/dak/process_policy.py b/dak/process_policy.py index 83ee19b5..dfe538fb 100755 --- a/dak/process_policy.py +++ b/dak/process_policy.py @@ -54,7 +54,7 @@ def do_comments(dir, srcqueue, opref, npref, line, fn, session): for comm in [ x for x in os.listdir(dir) if x.startswith(opref) ]: lines = open("%s/%s" % (dir, comm)).readlines() if len(lines) == 0 or lines[0] != line + "\n": continue - changes_files = [ x for x in os.listdir(".") if x.startswith(comm[7:]+"_") + changes_files = [ x for x in os.listdir(".") if x.startswith(comm[len(opref):]+"_") and x.endswith(".changes") ] changes_files = sort_changes(changes_files, session) for f in changes_files: @@ -65,9 +65,6 @@ def do_comments(dir, srcqueue, opref, npref, line, fn, session): continue fn(f, srcqueue, "".join(lines[1:]), session) - if len(changes_files) and not Options["No-Action"]: - store_changelog(changes_files[0], srcqueue) - if opref != npref and not Options["No-Action"]: newcomm = npref + comm[len(opref):] os.rename("%s/%s" % (dir, comm), "%s/%s" % (dir, newcomm)) @@ -116,21 +113,6 @@ def comment_reject(changes_file, srcqueue, comments, session): ################################################################################ -def store_changelog(changes_file, srcqueue): - Cnf = Config() - u = Upload() - u.pkg.changes_file = os.path.join(Cnf['Dir::Queue::Newstage'], changes_file) - u.load_changes(u.pkg.changes_file) - u.update_subst() - query = """INSERT INTO changelogs (source, version, suite, changelog) - VALUES (:source, :version, :suite, :changelog)""" - session = DBConn().session() - session.execute(query, {'source': u.pkg.changes['source'], 'version': u.pkg.changes['version'], \ - 'suite': srcqueue.queue_name, 'changelog': u.pkg.changes['changes']}) - session.commit() - -################################################################################ - def main(): global Options, Logger @@ -176,6 +158,7 @@ def main(): # The comments stuff relies on being in the right directory os.chdir(pq.path) do_comments(commentsdir, pq, "ACCEPT.", "ACCEPTED.", "OK", comment_accept, session) + do_comments(commentsdir, pq, "ACCEPTED.", "ACCEPTED.", "OK", comment_accept, session) do_comments(commentsdir, pq, "REJECT.", "REJECTED.", "NOTOK", comment_reject, session)