]> err.no Git - dak/commitdiff
Check if upload already has a changelog entry
authorLuca Falavigna <dktrkranz@debian.org>
Sat, 26 Jun 2010 11:57:06 +0000 (11:57 +0000)
committerLuca Falavigna <dktrkranz@debian.org>
Sat, 26 Jun 2010 11:57:06 +0000 (11:57 +0000)
Signed-off-by: Luca Falavigna <dktrkranz@debian.org>
daklib/queue.py

index 6accba0696faa3b84134e95df6e293764fe81302..3ab87246d1601f1fc5dd52912293deb155f95b38 100755 (executable)
@@ -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]