build-pkgs: exit if fails to create dsc

Force the build to exit if fails to create the needed
dsc file, report the error as soon as possible instead
of skipping it until the end.

Story: 2008846
Task: 45166

Test Plan:
Pass: Reproduce the issue that linux kernel build failed for
      no dsc file created
      The 'build-pkgs -a' should exit once the dsc fails to
      create

Signed-off-by: hbai <haiqing.bai@windriver.com>
Change-Id: If5c17ca577e8fd98e1a4af923fa463eb0fd988fc
This commit is contained in:
hbai 2022-04-25 09:58:34 +08:00
parent e1dc11e5c5
commit 16a5f3dc55

View File

@ -811,11 +811,11 @@ class BuildController():
if self.kits['repo_mgr']:
self.upload_with_dsc(pkg_name, dsc_file, REPO_SOURCE)
elif deb_recipes is None:
if self.attrs['exit_on_fail']:
if fdsc_file:
fdsc_file.close()
return
continue
# Exit if fails to create dsc file
if fdsc_file:
fdsc_file.close()
logger.error("Failed to create needed dsc file, exit")
return
else:
# Empty set indicates the package is unchanged
continue