]> git.decadent.org.uk Git - dak.git/blobdiff - dak/generate_packages_sources.py
Now it works :)
[dak.git] / dak / generate_packages_sources.py
index 6e91aedae5470474a5130c3bfe59d002816d4682..08940c7858944992ebba36641fbb207ddb123e05 100755 (executable)
@@ -274,7 +274,7 @@ tree "dists/proposed-updates/main"
     cnf = Config()
     try:
         # Write apt.conf
-        (ac_fd, ac_name) = mkstemp(dir=tmppath)
+        (ac_fd, ac_name) = mkstemp(dir=tmppath, suffix=suite, prefix=arch)
         os.write(ac_fd, DAILY_APT_CONF)
         # here we want to generate the tree entries
         os.write(ac_fd, apt_trees[suite] % {'arch': arch})
@@ -360,19 +360,19 @@ def main ():
     startdir = os.getcwd()
     os.chdir(cnf["Dir::TempPath"])
 
-    # Setup a multiprocessing Pool. As many workers as we have CPU cores.
-    pool = Pool()
-
     # For each given suite, each architecture, run one apt-ftparchive
     for s in suites:
+        # Setup a multiprocessing Pool. As many workers as we have CPU cores.
+        pool = Pool()
         arch_list=get_suite_architectures(s.suite_name, skipsrc=False, skipall=True, session=session)
         Logger.log(['generating output for Suite %s, Architectures %s' % (s.suite_name, map(sname, arch_list))])
         for a in arch_list:
             pool.apply_async(generate_packages_sources, (a.arch_string, s.suite_name, cnf["Dir::TempPath"]))
 
-    # No more work will be added to our pool, close it and then wait for all to finish
-    pool.close()
-    pool.join()
+        # No more work will be added to our pool, close it and then wait for all to finish
+        pool.close()
+        pool.join()
+
     os.chdir(startdir)
     # this script doesn't change the database
     session.close()