summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-10-04 17:57:50 -0500
committerDan McGee <dan@archlinux.org>2009-10-04 17:57:50 -0500
commitdcbf0725802ab70344fbbc2c54bca19a3dddfd01 (patch)
tree65c11132f5301210d850e5c63387181731e34bfe
parentc272173d8f5afc96e3230dae796bed2f8d1a0e89 (diff)
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 <dan@archlinux.org>
-rwxr-xr-xscripts/reporead.py17
1 files changed, 9 insertions, 8 deletions
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)