From: Luca Falavigna Date: Sat, 26 Jun 2010 11:57:06 +0000 (+0000) Subject: Check if upload already has a changelog entry X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=64adbd2b7e3e66d2dc69b11549341243a313d5b4;p=dak.git Check if upload already has a changelog entry Signed-off-by: Luca Falavigna --- diff --git a/daklib/queue.py b/daklib/queue.py index 6accba06..3ab87246 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -2686,6 +2686,15 @@ distribution.""" session = DBConn().session() + # Check if upload already has a changelog entry + query = """SELECT changelog_id FROM changes WHERE source = :source + AND version = :version AND architecture = :architecture AND changelog_id != 0""" + if session.execute(query, {'source': self.pkg.changes['source'], \ + 'version': self.pkg.changes['version'], \ + 'architecture': " ".join(self.pkg.changes['architecture'].keys())}).rowcount: + session.commit() + return + # Add current changelog text into changelogs_text table, return created ID query = "INSERT INTO changelogs_text (changelog) VALUES (:changelog) RETURNING id" ID = session.execute(query, {'changelog': self.pkg.changes['changes']}).fetchone()[0]