aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-08-18 18:45:31 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-08-18 18:45:31 +0000
commitc1abfb1ef4f5d485242ab2a40b55f88368487234 (patch)
treee8180d6b3a922b939e4ec2e539d2533ee6d1ad63
parentEnable forcing of updates. (diff)
downloadpackages-3-c1abfb1ef4f5d485242ab2a40b55f88368487234.tar.gz
packages-3-c1abfb1ef4f5d485242ab2a40b55f88368487234.tar.bz2
packages-3-c1abfb1ef4f5d485242ab2a40b55f88368487234.zip
Allow forcing of updates to propogate down.
-rw-r--r--dbgenerator/core.py4
-rw-r--r--dbgenerator/database.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/dbgenerator/core.py b/dbgenerator/core.py
index ed23707..73785f4 100644
--- a/dbgenerator/core.py
+++ b/dbgenerator/core.py
@@ -131,8 +131,8 @@ def main():
continue
changed = True
(cpi, cpvi, dummy, dummy) = \
- database.add_version(cat, pn, pv, mtime, sha1)
- database.add_keywords(cat, pn, pv, keywords_dict)
+ database.add_version(cat, pn, pv, mtime, sha1, force_update)
+ database.add_keywords(cat, pn, pv, keywords_dict, force_update)
if cpvi in old_cpvs:
old_cpvs.discard(cpvi)
else:
diff --git a/dbgenerator/database.py b/dbgenerator/database.py
index 1360b79..fe6b615 100644
--- a/dbgenerator/database.py
+++ b/dbgenerator/database.py
@@ -188,7 +188,7 @@ class SQLPackageDatabase(object):
VALUES
(?, ?, ?)
"""
- def add_keywords(self, category, pn, pv, keyword_dict):
+ def add_keywords(self, category, pn, pv, keyword_dict, force_update):
"""Replace keywords for the CPV with the new set"""
cpv = self.find_cpv(category, pn, pv)
if cpv is None:
@@ -274,7 +274,7 @@ class SQLPackageDatabase(object):
SET mtime = ?, sha1 = ?
WHERE cpv = ?
"""
- def add_version(self, category, pn, pv, mtime, sha1):
+ def add_version(self, category, pn, pv, mtime, sha1, force_update):
"""Create or update an entry in the versions list for a new CPV"""
cpv = self.find_cpv(category, pn, pv)
(cpi, is_cp_created) = self.find_or_create_cp(category, pn)
@@ -294,7 +294,7 @@ class SQLPackageDatabase(object):
ret = (cpi, cpvi, mtime, sha1)
else:
(cpvi, oldmtime, oldsha1) = cpv
- if oldmtime != mtime and oldsha1 != sha1:
+ if (oldmtime != mtime and oldsha1 != sha1) or force_update:
sql = self.sql['UPDATE_versions']
self.cursor.execute(sql, (mtime, sha1, cpvi, ))
ret = (cpi, cpvi, mtime, sha1)