]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
First implementation of make-changelog command
[dak.git] / daklib / dbconn.py
index 720e11e32e6a87a62a520aab300cc2ab27cb6b1d..fbebec5071126657aa19ac479080460faf7a5132 100755 (executable)
@@ -530,6 +530,12 @@ class BuildQueue(object):
 
             os.system("""apt-ftparchive -qq -o APT::FTPArchive::Release::Origin="%s" -o APT::FTPArchive::Release::Label="%s" -o APT::FTPArchive::Release::Description="%s" -o APT::FTPArchive::Release::Architectures="%s" release %s > Release""" % (self.origin, self.label, self.releasedescription, arches, bname))
 
+            # Crude hack with open and append, but this whole section is and should be redone.
+            if self.notautomatic:
+                release=open("Release", "a")
+                release.write("NotAutomatic: yes")
+                release.close()
+
             # Sign if necessary
             if self.signingkey:
                 cnf = Config()
@@ -2206,6 +2212,30 @@ def get_source_in_suite(source, suite, session=None):
 
 __all__.append('get_source_in_suite')
 
+@session_wrapper
+def get_all_sources_in_suite(suitename, session=None):
+    """
+    Returns list of sources and versions found in a given suite
+
+      - B{suite} - a suite name, eg. I{unstable}
+
+    @type suite: string
+    @param suite: the suite name
+
+    @rtype: dictionary
+    @return: the version for I{source} in I{suite}
+
+    """
+    query = """SELECT source, version FROM source_suite
+    WHERE suite_name=:suitename
+    ORDER BY source"""
+
+    vals = {'suitename': suitename}
+   
+    return session.execute(query, vals)
+
+__all__.append('get_all_sources_in_suite')
+
 ################################################################################
 
 @session_wrapper
@@ -2299,7 +2329,7 @@ def add_dsc_to_db(u, filename, session=None):
     # Add the src_uploaders to the DB
     uploader_ids = [source.maintainer_id]
     if u.pkg.dsc.has_key("uploaders"):
-        for up in u.pkg.dsc["uploaders"].split(","):
+        for up in u.pkg.dsc["uploaders"].replace(">, ", ">\t").split("\t"):
             up = up.strip()
             uploader_ids.append(get_or_set_maintainer(up, session).maintainer_id)