[Qa-jenkins-scm] [jenkins.debian.net] 02/08: reproducible: scheduler: do not change the notify_maintainer value on updates

Holger Levsen holger at moszumanska.debian.org
Fri May 29 14:25:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 43829245de41c8a2db8042b749d824be550d754c
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Thu May 28 22:09:15 2015 +0200

    reproducible: scheduler: do not change the notify_maintainer value on updates
---
 bin/reproducible_scheduler.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py
index f5b6932..851305f 100755
--- a/bin/reproducible_scheduler.py
+++ b/bin/reproducible_scheduler.py
@@ -66,7 +66,7 @@ def update_sources_tables(suite):
     log.debug('Packages different in the archive and in the db: ' +
               str(different_pkgs))
     for pkg in different_pkgs:
-        query = 'SELECT id, version FROM sources ' + \
+        query = 'SELECT id, version, notify_maintainer FROM sources ' + \
                 'WHERE name="{name}" AND suite="{suite}"'
         query = query.format(name=pkg[0], suite=pkg[2])
         try:
@@ -76,21 +76,25 @@ def update_sources_tables(suite):
             continue
         pkg_id = result[0]
         old_version = result[1]
+        notify_maint = int(result[2])
         if version_compare(pkg[1], old_version) > 0:
             log.debug('New version: ' + str(pkg) + ' (we had  ' +
                       old_version + ')')
-            updated_pkgs.append((pkg_id, pkg[0], pkg[1], pkg[2]))
+            updated_pkgs.append((pkg_id, pkg[0], pkg[1], pkg[2], notify_maint))
     # Now actually update the database:
     cursor = conn_db.cursor()
     # updated packages
-    log.info('Pushing ' + str(len(updated_pkgs)) + ' updated packages to the database...')
-    cursor.executemany('REPLACE INTO sources ' +
-                       '(id, name, version, suite, architecture) ' +
-                       'VALUES (?, ?, ?, ?, "{arch}")'.format(arch='amd64'),
-                       updated_pkgs)
+    log.info('Pushing ' + str(len(updated_pkgs)) +
+             ' updated packages to the database...')
+    cursor.executemany(
+        'REPLACE INTO sources ' +
+        '(id, name, version, suite, architecture, notify_maintainer) ' +
+        'VALUES (?, ?, ?, ?, "{arch}", ?)'.format(arch='amd64'),
+        updated_pkgs)
     conn_db.commit()
     # new packages
-    log.info('Now inserting ' + str(len(pkgs_to_add)) + ' new sources in the database: ' +
+    log.info('Now inserting ' + str(len(pkgs_to_add)) +
+             ' new sources in the database: ' +
              str(pkgs_to_add))
     cursor.executemany('INSERT INTO sources ' +
                        '(name, version, suite, architecture) ' +
@@ -100,7 +104,8 @@ def update_sources_tables(suite):
     cur_pkgs_name = [x[0] for x in cur_pkgs]
     new_pkgs_name = [x[0] for x in new_pkgs]
     rmed_pkgs = [x for x in cur_pkgs_name if x not in new_pkgs_name]
-    log.info('Now deleting ' + str(len(rmed_pkgs)) + ' removed packages: ' + str(rmed_pkgs))
+    log.info('Now deleting ' + str(len(rmed_pkgs)) +
+             ' removed packages: ' + str(rmed_pkgs))
     rmed_pkgs_id = []
     pkgs_to_rm = []
     for pkg in rmed_pkgs:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list