build-pkgs: Fixed "exit on failure" feature broken

"-e" option of build-pkgs means exiting on any package
build failure instead of continuing to run. This feature
was broken during the code merging, now brings the feature
back.

Test Plan:
Pass: For monolithic build, package build failure should
      result in a safe exit with '-e' option:
      build-pkgs -e

Pass: For single build with '-p', package build failure
      should result in a safe exit with '-e' option:
      build-pkgs -e -p <packages>

Closes-bug: 2054720

Change-Id: I5bf2089aa3559a8131f0e238a75edea87733dea6
Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
This commit is contained in:
Haiqing Bai 2024-02-23 02:19:31 +08:00
parent 0b24411a7c
commit 48ad94bac0
1 changed files with 3 additions and 0 deletions

View File

@ -1594,6 +1594,9 @@ class BuildController():
logger.warning('Notified dsc_depend to retrieve %s', done_pkg_name)
self.req_kill_task('sbuild', done_dsc)
logger.debug('Require pkgbuilder to clean the task for %s', done_pkg_name)
if self.attrs['exit_on_fail']:
logger.error("Exiting due to failed package build")
return
continue
self.req_kill_task('sbuild', done_dsc)
logger.debug('Require pkgbuilder to clean the task for %s', done_pkg_name)