From b43f0a27191bcf2d20e4fa24ad2be8723ccbf518 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Sat, 23 May 2009 22:34:32 +0100 Subject: [PATCH] add get_binary_components (from p-u) Signed-off-by: Mark Hymers --- daklib/dbconn.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 3cfcac10..cf9ca9a5 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -210,6 +210,23 @@ def get_binaries_from_name(package, session=None): __all__.append('get_binaries_from_name') +def get_binary_components(package, suitename, arch, session=None): +# Check for packages that have moved from one component to another + query = """SELECT c.name FROM binaries b, bin_associations ba, suite s, location l, component c, architecture a, files f + WHERE b.package=:package AND s.suite_name=:suitename + AND (a.arch_string = :arch OR a.arch_string = 'all') + AND ba.bin = b.id AND ba.suite = s.id AND b.architecture = a.id + AND f.location = l.id + AND l.component = c.id + AND b.file = f.id""" + + vals = {'package': package, 'suitename': suitename, 'arch': arch} + + if session is None: + session = DBConn().session() + return session.execute(query, vals) + +__all__.append('get_binary_components') ################################################################################ class Component(object): -- 2.39.5