X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fshow_new.py;h=7396d3ccd99af1b357b6fdb1ae19d64163c61a0d;hb=3b8862ae0e21fae9fc552d4df160f45684976d7d;hp=dd6a4a434189d1ee7f02716ac57fdc8c3874c476;hpb=b15de7d2f6d361db0fd71588003a6ffee57a1dcd;p=dak.git diff --git a/dak/show_new.py b/dak/show_new.py index dd6a4a43..7396d3cc 100755 --- a/dak/show_new.py +++ b/dak/show_new.py @@ -37,7 +37,7 @@ from daklib.regexes import re_source_ext from daklib.config import Config from daklib import daklog from daklib.changesutils import * -from daklib.threadpool import ThreadPool +from daklib.dakmultiprocessing import DakProcessPool # Globals Cnf = None @@ -166,7 +166,7 @@ def do_pkg(changes_file): sources.add(htmlname) htmlfile = os.path.join(cnf["Show-New::HTMLPath"], htmlname) - if os.path.exists(htmlfile) and + if os.path.exists(htmlfile) and \ os.stat(htmlfile).st_mtime > os.stat(origchanges).st_mtime: session.close() return @@ -180,7 +180,7 @@ def do_pkg(changes_file): u.check_source_against_db(deb_filename, session) u.pkg.changes["suite"] = u.pkg.changes["distribution"] - new, byhand = determine_new(u.pkg.changes_file, u.pkg.changes, files, 0, session) + new, byhand = determine_new(u.pkg.changes_file, u.pkg.changes, files, 0, dsc=u.pkg.dsc, session=session) outfile = open(os.path.join(cnf["Show-New::HTMLPath"],htmlname),"w") @@ -250,14 +250,15 @@ def main(): examine_package.use_html=1 - threadpool = ThreadPool() + pool = DakProcessPool() for changes_file in changes_files: changes_file = utils.validate_changes_file_arg(changes_file, 0) if not changes_file: continue print "\n" + changes_file - threadpool.queueTask(do_pkg, changes_file) - threadpool.joinAll() + pool.apply_async(do_pkg, (changes_file,)) + pool.close() + pool.join() files = set(os.listdir(cnf["Show-New::HTMLPath"])) to_delete = filter(lambda x: x.endswith(".html"), files.difference(sources))