buildbot: fix rebuild

This commit is contained in:
JerryXiao 2019-11-11 12:48:54 +08:00
parent 02cc370e41
commit 6dc56262bc

View file

@ -134,6 +134,7 @@ class jobsManager:
if updates and len(updates) == 1: if updates and len(updates) == 1:
(pkgconfig, ver, buildarchs) = updates[0] (pkgconfig, ver, buildarchs) = updates[0]
fakejob = Job(buildarchs[0], pkgconfig, ver) fakejob = Job(buildarchs[0], pkgconfig, ver)
self.__sign(fakejob)
if self.__upload(fakejob, overwrite=overwrite): if self.__upload(fakejob, overwrite=overwrite):
ret = f'done force_upload {pkgdirname}' ret = f'done force_upload {pkgdirname}'
logger.info(ret) logger.info(ret)
@ -408,6 +409,7 @@ class updateManager:
self.__pkgerrs = dict() self.__pkgerrs = dict()
self.__pkgvers = dict() self.__pkgvers = dict()
self.__load() self.__load()
self.__rebuilding = False
@property @property
def pkgvers(self): def pkgvers(self):
return self.__pkgvers return self.__pkgvers
@ -456,11 +458,16 @@ class updateManager:
updates = list() updates = list()
for pkg in jobsmgr.pkgconfigs: for pkg in jobsmgr.pkgconfigs:
try: try:
if self.__rebuilding and not rebuild_package:
logger.info(f'Stop checking updates for rebuild.')
break
else:
self.__rebuilding = bool(rebuild_package)
if rebuild_package and \ if rebuild_package and \
rebuild_package != pkg.dirname: rebuild_package != pkg.dirname:
continue continue
pkgdir = REPO_ROOT / pkg.dirname pkgdir = REPO_ROOT / pkg.dirname
logger.info(f'checking update: {pkg.dirname}') logger.info(f'{"[rebuild] " if rebuild_package else ""}checking update: {pkg.dirname}')
if self.__pkgerrs.get(pkg.dirname, 0) >= 2: if self.__pkgerrs.get(pkg.dirname, 0) >= 2:
logger.warning(f'package: {pkg.dirname} too many failures checking update') logger.warning(f'package: {pkg.dirname} too many failures checking update')
if rebuild_package is None: if rebuild_package is None:
@ -509,6 +516,7 @@ class updateManager:
self.__pkgerrs[pkg.dirname] = self.__pkgerrs.get(pkg.dirname, 0) + 1 self.__pkgerrs[pkg.dirname] = self.__pkgerrs.get(pkg.dirname, 0) + 1
print_exc_plus() print_exc_plus()
self._save() self._save()
self.__rebuilding = False
return updates return updates
updmgr = updateManager() updmgr = updateManager()