X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=21c9cc626a82956b8e75fb207073cf0abb692e09;hb=a4a019fa541fec6ad205f5e36e5f2a2cdf797235;hp=6070cded680d560e9cfc4ccca366993eea30c8a7;hpb=f3db7ee80798580c7e5a0e1f48e008bc22a8bdfc;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 6070cded..21c9cc62 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -452,6 +452,32 @@ class DBConn(Singleton): return id + def get_suite_architectures(self, suite): + """ + Returns list of architectures for C{suite}. + + @type suite: string, int + @param suite: the suite name or the suite_id + + @rtype: list + @return: the list of architectures for I{suite} + """ + + suite_id = None + if type(suite) == str: + suite_id = self.get_suite_id(suite) + elif type(suite) == int: + suite_id = suite + else: + return None + + c = self.db_con.cursor() + c.execute( """SELECT a.arch_string FROM suite_architectures sa + JOIN architecture a ON (a.id = sa.architecture) + WHERE suite='%s'""" % suite_id ) + + return map(lambda x: x[0], c.fetchall()) + def insert_content_paths(self, package, fullpaths): """ Make sure given path is associated with given binary id