From: Alexander Reichle-Schmehl Date: Thu, 16 Dec 2010 13:21:16 +0000 (+0000) Subject: Merge branch 'typofix' X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b5b25234382f20595be0b8dad19f6502fb704b52;hp=310e68d162db3006294b9df3d4d715bb9ceac822;p=dak.git Merge branch 'typofix' --- diff --git a/config/debian-security/dak.conf b/config/debian-security/dak.conf index 151f006a..0f77a7f4 100644 --- a/config/debian-security/dak.conf +++ b/config/debian-security/dak.conf @@ -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 diff --git a/dak/generate_filelist.py b/dak/generate_filelist.py index a2246f5c..a58fe7e2 100755 --- a/dak/generate_filelist.py +++ b/dak/generate_filelist.py @@ -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()] diff --git a/dak/make_overrides.py b/dak/make_overrides.py index 02c7f7c2..b925d927 100755 --- a/dak/make_overrides.py +++ b/dak/make_overrides.py @@ -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() diff --git a/daklib/changesutils.py b/daklib/changesutils.py old mode 100644 new mode 100755 index b268add5..3a4c6dd7 --- a/daklib/changesutils.py +++ b/daklib/changesutils.py @@ -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') diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 5a92dc81..25ba49e1 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -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: diff --git a/daklib/queue_install.py b/daklib/queue_install.py index d016c986..b2735360 100755 --- a/daklib/queue_install.py +++ b/daklib/queue_install.py @@ -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