diff options
author | 2007-10-20 03:33:43 +0000 | |
---|---|---|
committer | 2007-10-20 03:33:43 +0000 | |
commit | e35ae735d2d3ac7610bc7cfe6fde98525210089a (patch) | |
tree | 7410d2053f4347aba4865b165093aeabce8be110 /dbgenerator | |
parent | Check lower bound of count inputs, and pylint cleanup. (diff) | |
download | packages-3-e35ae735d2d3ac7610bc7cfe6fde98525210089a.tar.gz packages-3-e35ae735d2d3ac7610bc7cfe6fde98525210089a.tar.bz2 packages-3-e35ae735d2d3ac7610bc7cfe6fde98525210089a.zip |
The timestamp variable is actually the mtime from previous passes, use a better name for it. Also factor out a part of initdb logic for later use.
Diffstat (limited to 'dbgenerator')
-rw-r--r-- | dbgenerator/core.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dbgenerator/core.py b/dbgenerator/core.py index 87149bf..fae41e2 100644 --- a/dbgenerator/core.py +++ b/dbgenerator/core.py @@ -47,25 +47,27 @@ def main(): """build new / refresh current package database""" (backend, database) = init_front_back() + not_init = not database.initdb #iter over all packages for (category, package) in backend.all_packages_list: - max_timestamp = 0 + max_oldmtime = 0 max_mtime = 0 # iter over ebuilds for keyword data versions = backend.get_package_keywords_dict((category, package)) for version, keywords_dict, mtime in versions: - if not database.initdb: - timestamp = database.find_cpv_mtime(category, package, version) - max_timestamp = max(max_timestamp, timestamp) + mtime = int(mtime) + if not_init: + oldmtime = database.find_cpv_mtime(category, package, version) + max_oldmtime = max(max_oldmtime, oldmtime) max_mtime = max(max_mtime, mtime) - if timestamp >= mtime: + if oldmtime >= mtime: continue database.add_version(category, package, version, mtime) database.add_keywords(category, package, version, keywords_dict) - if not database.initdb and max_timestamp >= max_mtime: + if not_init and max_oldmtime >= max_mtime: #print "Skipping %s/%s" % (category, package) continue |