]> git.decadent.org.uk Git - dak.git/commitdiff
Merge branch 'typofix'
authorAlexander Reichle-Schmehl <alexander@schmehl.info>
Thu, 16 Dec 2010 13:21:16 +0000 (13:21 +0000)
committerAlexander Reichle-Schmehl <alexander@schmehl.info>
Thu, 16 Dec 2010 13:21:16 +0000 (13:21 +0000)
config/debian-security/dak.conf
dak/generate_filelist.py
dak/make_overrides.py
daklib/changesutils.py [changed mode: 0644->0755]
daklib/dbconn.py
daklib/queue_install.py

index 151f006ad7a52e11635c165d369e33aa4c20d54f..0f77a7f49e61b9286f13890a8932d36d8bda4318 100644 (file)
@@ -39,6 +39,7 @@ Dinstall
 Process-New
 {
   AcceptedLockFile "/org/security.debian.org/lock/unchecked.lock";
+  LockDir "/srv/security-master.debian.org/lock/new/";
 };
 
 Import-Users-From-Passwd
index a2246f5cd3707dbf656886ffcee2bb356140064f..a58fe7e2c45d50288b9d135d82a716d58e319eb5 100755 (executable)
@@ -196,9 +196,11 @@ def main():
     suites = [suite.suite_name for suite in query_suites.all()]
     if not cnf.has_key('Filelist::Options::Suite'):
         cnf['Filelist::Options::Suite'] = ','.join(suites)
-    # we can ask the database for components if 'mixed' is gone
+    query_components = session.query(Component)
+    components = \
+        [component.component_name for component in query_components.all()]
     if not cnf.has_key('Filelist::Options::Component'):
-        cnf['Filelist::Options::Component'] = 'main,contrib,non-free'
+        cnf['Filelist::Options::Component'] = ','.join(components)
     query_architectures = session.query(Architecture)
     architectures = \
         [architecture.arch_string for architecture in query_architectures.all()]
index 02c7f7c2988843d8f6ffe31364c5e58ca789ac2e..b925d927c294108d3998bb7abcc9703abb307587 100755 (executable)
@@ -141,7 +141,9 @@ def main ():
                 elif otype_name == "dsc":
                     suffix = ".src"
 
-                filename = os.path.join(cnf["Dir::Override"], "override.%s.%s%s" % (override_suite, component.component_name, suffix))
+                cname = component.component_name.replace('/', '_')
+                filename = os.path.join(cnf["Dir::Override"], "override.%s.%s%s" % (override_suite, cname, suffix))
+
                 output_file = utils.open_file(filename, 'w')
                 do_list(output_file, suite, component, otype, session)
                 output_file.close()
old mode 100644 (file)
new mode 100755 (executable)
index b268add..3a4c6dd
@@ -178,26 +178,14 @@ def new_accept(upload, dry_run, session):
         cnf = Config()
 
         (summary, short_summary) = upload.build_summaries()
+        destqueue = get_policy_queue('newstage', session)
 
-        # XXX: mhy: I think this is wrong as these are all attributes on the
-        # build and policy queues now
-        if cnf.FindB("Dinstall::SecurityQueueHandling"):
-            upload.dump_vars(cnf["Dir::Queue::Embargoed"])
-            upload.move_to_queue(get_policy_queue('embargoed'))
-            upload.queue_build("embargoed", cnf["Dir::Queue::Embargoed"])
-            # Check for override disparities
-            upload.Subst["__SUMMARY__"] = summary
-        else:
-            # Just a normal upload, accept it...
-            (summary, short_summary) = upload.build_summaries()
-            destqueue = get_policy_queue('newstage', session)
-
-            srcqueue = get_policy_queue_from_path(upload.pkg.directory, session)
+        srcqueue = get_policy_queue_from_path(upload.pkg.directory, session)
 
-            if not srcqueue:
-                # Assume NEW and hope for the best
-                srcqueue = get_policy_queue('new', session)
+        if not srcqueue:
+            # Assume NEW and hope for the best
+            srcqueue = get_policy_queue('new', session)
 
-            changes_to_queue(upload, srcqueue, destqueue, session)
+        changes_to_queue(upload, srcqueue, destqueue, session)
 
 __all__.append('new_accept')
index 5a92dc8146c39e365b85f012b22a0a81717e1153..25ba49e1e3a3e61b9046fd9de450f4ca8033b4de 100755 (executable)
@@ -615,7 +615,7 @@ class BuildQueue(object):
         session.commit()
 
         for f in os.listdir(self.path):
-            if f.startswith('Packages') or f.startswith('Source') or f.startswith('Release'):
+            if f.startswith('Packages') or f.startswith('Source') or f.startswith('Release') or f.startswith('advisory'):
                 continue
 
             try:
index d016c98638619ed9888333c6d8bf907d806a030f..b273536058c603c5bc487d32d33fa4377a9f5716 100755 (executable)
@@ -78,49 +78,84 @@ def package_to_queue(u, summary, short_summary, queue, chg, session, announce=No
 
 ################################################################################
 
-# TODO: This logic needs to be replaced with policy queues before we upgrade
-# security master
-
-#def is_unembargo(u):
-#    session = DBConn().session()
-#    cnf = Config()
-#
-#    q = session.execute("SELECT package FROM disembargo WHERE package = :source AND version = :version", u.pkg.changes)
-#    if q.rowcount > 0:
-#        session.close()
-#        return True
-#
-#    oldcwd = os.getcwd()
-#    os.chdir(cnf["Dir::Queue::Disembargo"])
-#    disdir = os.getcwd()
-#    os.chdir(oldcwd)
-#
-#    ret = False
-#
-#    if u.pkg.directory == disdir:
-#        if u.pkg.changes["architecture"].has_key("source"):
-#            session.execute("INSERT INTO disembargo (package, version) VALUES (:package, :version)", u.pkg.changes)
-#            session.commit()
-#
-#            ret = True
-#
-#    session.close()
-#
-#    return ret
-#
-#def queue_unembargo(u, summary, short_summary, session=None):
-#    return package_to_queue(u, summary, short_summary, "Unembargoed",
-#                            perms=0660, build=True, announce='process-unchecked.accepted')
+def is_unembargo(u):
+   session = DBConn().session()
+   cnf = Config()
+
+   # If we dont have the disembargo queue we are not on security and so not interested
+   # in doing any security queue handling
+   if not get_policy_queue("disembargo"):
+       return False
+
+   # If we already are in newstage, then it means this just got passed through and accepted
+   # by a security team member. Don't try to accept it for disembargo again
+   dbc = get_dbchange(u.pkg.changes_file, session)
+   if dbc and dbc.in_queue.queue_name in [ 'newstage' ]:
+       return False
+
+   q = session.execute("SELECT package FROM disembargo WHERE package = :source AND version = :version",
+                       {'source': u.pkg.changes["source"],
+                        'version': u.pkg.changes["version"]})
+   if q.rowcount > 0:
+       session.close()
+       return True
+
+   oldcwd = os.getcwd()
+   os.chdir(cnf["Dir::Queue::Disembargo"])
+   disdir = os.getcwd()
+   os.chdir(oldcwd)
+
+   ret = False
+
+   if u.pkg.directory == disdir:
+       if u.pkg.changes["architecture"].has_key("source"):
+           session.execute("INSERT INTO disembargo (package, version) VALUES (:source, :version)",
+                           {'source': u.pkg.changes["source"],
+                            'version': u.pkg.changes["version"]})
+           session.commit()
+
+           ret = True
+
+   session.close()
+
+   return ret
+
+def do_unembargo(u, summary, short_summary, chg, session=None):
+    polq=get_policy_queue('disembargo')
+    package_to_queue(u, summary, short_summary,
+                     polq, chg, session,
+                     announce=None)
+    for suite_name in u.pkg.changes["distribution"].keys():
+        suite = get_suite(suite_name, session)
+        for q in suite.copy_queues:
+            for f in u.pkg.files.keys():
+                os.symlink(os.path.join(polq.path, f), os.path.join(q.path, f))
 #
 #################################################################################
 #
-#def is_embargo(u):
-#    # if embargoed queues are enabled always embargo
-#    return True
-#
-#def queue_embargo(u, summary, short_summary, session=None):
-#    return package_to_queue(u, summary, short_summary, "Unembargoed",
-#                            perms=0660, build=True, announce='process-unchecked.accepted')
+def is_embargo(u):
+   # if we are the security archive, we always have a embargo queue and its the
+   # last in line, so if that exists, return true
+   # Of course do not return true when we accept from out of newstage, as that means
+   # it just left embargo and we want it in the archive
+   if get_policy_queue('embargo'):
+       session = DBConn().session()
+       dbc = get_dbchange(u.pkg.changes_file, session)
+       if dbc and dbc.in_queue.queue_name in [ 'newstage' ]:
+           return False
+
+       return True
+
+def do_embargo(u, summary, short_summary, chg, session=None):
+    polq=get_policy_queue('embargo')
+    package_to_queue(u, summary, short_summary,
+                     polq, chg, session,
+                     announce=None)
+    for suite_name in u.pkg.changes["distribution"].keys():
+        suite = get_suite(suite_name, session)
+        for q in suite.copy_queues:
+            for f in u.pkg.files.keys():
+                os.symlink(os.path.join(polq.path, f), os.path.join(q.path, f))
 
 ################################################################################
 
@@ -241,11 +276,16 @@ def acknowledge_new(u, summary, short_summary, chg, session):
 
 ################################################################################
 
+# FIXME: queues should be able to get autobuild
+#        the current logic doesnt allow this, as buildd stuff is AFTER accept...
+#        embargo/disembargo use a workaround due to this
 # q-unapproved hax0ring
 QueueInfo = {
     "new": { "is": is_new, "process": acknowledge_new },
     "autobyhand" : { "is" : is_autobyhand, "process": do_autobyhand },
     "byhand" : { "is": is_byhand, "process": do_byhand },
+    "embargoed" : { "is": is_embargo, "process": do_embargo },
+    "unembargoed" : { "is": is_unembargo, "process": do_unembargo },
 }
 
 def determine_target(u):
@@ -254,7 +294,7 @@ def determine_target(u):
     # Statically handled queues
     target = None
 
-    for q in ["autobyhand", "byhand", "new"]:
+    for q in ["autobyhand", "byhand", "new", "unembargoed", "embargoed"]:
         if QueueInfo[q]["is"](u):
             target = q
             break