From dcbf0725802ab70344fbbc2c54bca19a3dddfd01 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 4 Oct 2009 17:57:50 -0500 Subject: reporead: ensure we catch all testing repos in ratio check With community testing, we want to ignore the ratio check failure there as well. Clean up the whole check a bit and store the percentage in a variable as it is useful in both checks and for output purposes. Signed-off-by: Dan McGee --- scripts/reporead.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'scripts/reporead.py') diff --git a/scripts/reporead.py b/scripts/reporead.py index daed1f0b..9ff66c58 100755 --- a/scripts/reporead.py +++ b/scripts/reporead.py @@ -219,14 +219,15 @@ def db_update(archname, pkgs): logger.info("%d packages in sync not db" % len(in_sync_not_db)) # Try to catch those random orphaning issues that make Eric so unhappy. - if len(syncset) < len(dbset) * .5: - logger.error(".db.tar.gz has less than 50% the number of packages in the web database") - if repository.name != 'Testing': - raise SomethingFishyException( - 'It looks like the syncdb is half the size of the web db. WTF?') - - if len(syncset) < len(dbset) * .75: - logger.warning(".db.tar.gz has 75% the number of packages in the web database.") + dbpercent = 100.0 * len(syncset) / len(dbset) + logger.info("DB package ratio: %.1f%%" % dbpercent) + if dbpercent < 50.0 and repository.name.lower().find('testing') == -1: + logger.error(".db.tar.gz has %.1f%% the number of packages in the web database" % dbpercent) + raise SomethingFishyException( + 'It looks like the syncdb is less than half the size of the web db. WTF?') + + if dbpercent < 75.0: + logger.warning(".db.tar.gz has %.1f%% the number of packages in the web database." % dbpercent) for p in [x for x in pkgs if x.name in in_sync_not_db]: logger.info("Adding package %s", p.name) -- cgit v1.2.3-54-g00ecf