From 907e583d68fae9d14ac9b5b022f0703c1d3b51b3 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 11 Mar 2009 01:11:39 -0400 Subject: Emit total download/unpack counts at end of run (so we know when it finishes) --- server/debuginfofs-mirror | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/debuginfofs-mirror b/server/debuginfofs-mirror index 9dbcac3..2db31f6 100755 --- a/server/debuginfofs-mirror +++ b/server/debuginfofs-mirror @@ -338,6 +338,8 @@ def main(): if not opt.keep_src: # Rather than extracting and then deleting, just don't extract it excludepat="*/usr/src/debug/*" + downloadcount=0 + unpackcount=0 for p in unpack_packages + download_packages: if p in download_packages: repo = y.repos.getRepo(p.repoid) @@ -347,6 +349,7 @@ def main(): y.logger.error(str(e)) y.logger.error("Can't download %s; skipping" % pkg_to_nevra(p)) continue + downloadcount += 1 if opt.download_only: continue local = p.localpath @@ -357,6 +360,7 @@ def main(): y.verbose_logger.info("Unpacking %s" % nevra) unpack_rpm(local, targetdir, excludepat=excludepat) + unpackcount += 1 # Remove cached package now that we've unpacked it if not opt.savecache: os.unlink(local) @@ -366,6 +370,8 @@ def main(): if not opt.keep_lib: # TODO: it'd be good to nuke all of the extra dirs shutil.rmtree(os.path.join(targetdir,"usr/lib/debug")) + y.verbose_logger.info("Downloaded %i packages" % downloadcount) + y.verbose_logger.info("Unpacked %i packages" % unpackcount) if __name__ == '__main__': try: -- cgit