def time_max(self):
return self.data.time_max
+ def set_update_forced(self, update_forced):
+ self._set_attribute("update_forced", update_forced)
+
+ update_forced = property(lambda s: s.data.update_forced, set_update_forced)
+
def _log_build(self, action, build, from_repo=None, to_repo=None, user=None):
user_id = None
if user:
self.db.execute("DELETE FROM repositories_builds \
WHERE repo_id = %s AND build_id = %s", self.id, build.id)
+ # Force regenerating the index
+ self.update_forced = True
+
if log:
self._log_build("removed", build, from_repo=self, user=user)
self.db.execute("UPDATE repositories_builds SET repo_id = %s, time_added = NOW() \
WHERE repo_id = %s AND build_id = %s", to_repo.id, self.id, build.id)
+ # Force regenerating the index
+ self.update_forced = True
+
# Update bug status.
build._update_bugs_helper(to_repo)
self.db.execute("UPDATE repositories SET last_update = NOW() \
WHERE id = %s", self.id)
+ # Reset forced update flag
+ self.update_forced = False
+
def remaster(self):
log.info("Going to update repository %s..." % self.name)
changed = True
# No need to regenerate the index if the repository hasn't changed
- if not changed:
+ if not changed and not self.update_forced:
continue
- # Update the timestamp when we started at last
- self.updated()
-
# Find the key to sign the package.
key_id = None
if self.key:
name="%s - %s.%s" % (self.distro.name, self.name, arch),
key_id=key_id)
+ # Update the timestamp when we started at last
+ self.updated()
+
def cleanup(self):
log.info("Cleaning up repository %s..." % self.name)