]> err.no Git - dak/commitdiff
Added dm-upload-allowed flag to exist, and added support for all
authorMichael Casadevall <sonicmctails@gmail.com>
Fri, 26 Dec 2008 12:31:32 +0000 (07:31 -0500)
committerMichael Casadevall <sonicmctails@gmail.com>
Fri, 26 Dec 2008 18:09:33 +0000 (13:09 -0500)
uploaders to properly appear in src_uploaders table as per Tom's suggestion

SQL database change:
ALTER TABLE source ADD COLUMN dm_upload_allowed BOOLEAN DEFAULT 'no' NOT NULL;

ChangeLog
dak/process_accepted.py
dak/process_unchecked.py
setup/init_pool.sql

index 06516ccd498e482611fae23843e0a852524bfea5..950363612df2830344782d35eda471a6ce009fe4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-26  Michael Casadevall <sonicmctails@gmail.com>
+
+        * dak/process_unchecked.py - Implemented new dm_upload_allowed field in source
+
+        * dak/process_accepted.py - Ditto, also causes new uploads to include uploaders
+          table to properly include all uploads
+
+        * setup/init_pool.sql - Updated schema
+
 2008-12-23  Michael Casadevall <sonicmctails@gmail.com>
 
         * dak/queue_report.py - Added 822 output format
index 0d5a5387e3fbcf556c96872608d93cfc843f9005..ea238ef783d1eed36ab0861a27633e820a3cb2d4 100755 (executable)
@@ -298,10 +298,14 @@ def install ():
             filename = files[file]["pool name"] + file
             dsc_component = files[file]["component"]
             dsc_location_id = files[file]["location id"]
+            if dsc.has_key("dm-upload-allowed") and  dsc["dm-upload-allowed"] == "yes":
+                dm_upload_allowed = "true"
+            else:
+                dm_upload_allowed = "false"
             if not files[file].has_key("files id") or not files[file]["files id"]:
                 files[file]["files id"] = database.set_files_id (filename, files[file]["size"], files[file]["md5sum"], files[file]["sha1sum"], files[file]["sha256sum"], dsc_location_id)
-            projectB.query("INSERT INTO source (source, version, maintainer, changedby, file, install_date, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, '%s', %s)"
-                           % (package, version, maintainer_id, changedby_id, files[file]["files id"], install_date, fingerprint_id))
+            projectB.query("INSERT INTO source (source, version, maintainer, changedby, file, install_date, sig_fpr, dm_upload_allowed) VALUES ('%s', '%s', %d, %d, %d, '%s', %s, %s)"
+                           % (package, version, maintainer_id, changedby_id, files[file]["files id"], install_date, fingerprint_id, dm_upload_allowed))
 
             for suite in changes["distribution"].keys():
                 suite_id = database.get_suite_id(suite)
@@ -322,21 +326,20 @@ def install ():
                 projectB.query("INSERT INTO dsc_files (source, file) VALUES (currval('source_id_seq'), %d)" % (files_id))
 
             # Add the src_uploaders to the DB
-            if dsc.get("dm-upload-allowed", "no") == "yes":
-                uploader_ids = [maintainer_id]
-                if dsc.has_key("uploaders"):
-                    for u in dsc["uploaders"].split(","):
-                        u = u.replace("'", "\\'")
-                        u = u.strip()
-                        uploader_ids.append(
-                            database.get_or_set_maintainer_id(u))
-                added_ids = {}
-                for u in uploader_ids:
-                    if added_ids.has_key(u):
-                        utils.warn("Already saw uploader %s for source %s" % (u, package))
-                        continue
-                    added_ids[u]=1
-                    projectB.query("INSERT INTO src_uploaders (source, maintainer) VALUES (currval('source_id_seq'), %d)" % (u))
+            uploader_ids = [maintainer_id]
+            if dsc.has_key("uploaders"):
+                for u in dsc["uploaders"].split(","):
+                    u = u.replace("'", "\\'")
+                    u = u.strip()
+                    uploader_ids.append(
+                        database.get_or_set_maintainer_id(u))
+            added_ids = {}
+            for u in uploader_ids:
+                if added_ids.has_key(u):
+                    utils.warn("Already saw uploader %s for source %s" % (u, package))
+                    continue
+                added_ids[u]=1
+                projectB.query("INSERT INTO src_uploaders (source, maintainer) VALUES (currval('source_id_seq'), %d)" % (u))
 
 
     # Add the .deb files to the DB
index 690c1c115e19a51f66f29244b09c33e6bb8d0684..2a479ced62e457ff29a897b08901dcf0270cba32 100755 (executable)
@@ -1054,7 +1054,7 @@ def check_signed_by_key():
         is_nmu = 1
         for si in source_ids:
             is_nmu = 1
-            q = Upload.projectB.query("SELECT m.name FROM maintainer m WHERE m.id IN (SELECT maintainer FROM src_uploaders WHERE src_uploaders.source = %s)" % (si))
+            q = Upload.projectB.query("SELECT m.name FROM maintainer m WHERE m.id IN (SELECT su.maintainer FROM src_uploaders su JOIN source s ON (s.id = su.source) WHERE su.source = %s AND s.dm_upload_allowed = 'yes')" % (si))
             for m in q.getresult():
                 (rfc822, rfc2047, name, email) = utils.fix_maintainer(m[0])
                 if email == uid_email or name == uid_name:
index 1e3639406cf1c8f79b072a1eb90e13f3a070c995..6d295dbf1c60a0a032f6f6fbb3221a1a3597160a 100644 (file)
@@ -84,6 +84,7 @@ CREATE TABLE source (
         file INT4 UNIQUE NOT NULL, -- REFERENCES files
        install_date TIMESTAMP NOT NULL,
        sig_fpr INT4 NOT NULL, -- REFERENCES fingerprint
+        dm-upload-allowed BOOLEAN NOT NULL,
        unique (source, version)
 );