diff --git a/common_factories.py b/common_factories.py index 09ef8096..579c37bb 100644 --- a/common_factories.py +++ b/common_factories.py @@ -23,9 +23,9 @@ hasDockerLibrary, hasEco, hasFailed, - hasFiles, hasGalera, hasInstall, + hasPackagesGenerated, hasRpmLint, hasS3, hasUpgrade, @@ -755,7 +755,7 @@ def getRpmAutobakeFactory(mtrDbPool): """ ), doStepIf=( - lambda step: hasFiles(step) + lambda step: hasPackagesGenerated(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) ), descriptionDone=util.Interpolate( @@ -797,7 +797,7 @@ def getRpmAutobakeFactory(mtrDbPool): doStepIf=( lambda step: hasInstall(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) @@ -816,7 +816,7 @@ def getRpmAutobakeFactory(mtrDbPool): doStepIf=( lambda step: hasUpgrade(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) diff --git a/master.cfg b/master.cfg index af0579d7..27dc0b7b 100644 --- a/master.cfg +++ b/master.cfg @@ -258,7 +258,7 @@ f_deb_autobake.addStep( doStepIf=( lambda step: hasInstall(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) @@ -277,7 +277,7 @@ f_deb_autobake.addStep( doStepIf=( lambda step: hasUpgrade(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) diff --git a/utils.py b/utils.py index 8077cb91..0a9ff479 100644 --- a/utils.py +++ b/utils.py @@ -207,7 +207,7 @@ def createDebRepo() -> steps.ShellCommand: ), ], doStepIf=( - lambda step: hasFiles(step) + lambda step: hasPackagesGenerated(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) ), ) @@ -249,7 +249,7 @@ def uploadDebArtifacts() -> steps.ShellCommand: ), ], doStepIf=( - lambda step: hasFiles(step) + lambda step: hasPackagesGenerated(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) ), descriptionDone=util.Interpolate( @@ -322,7 +322,7 @@ def ls2string(rc: int, stdout: str, stderr: str) -> dict[str, str]: ls_filenames = [] for line in stdout.strip().split("\n"): line = line.strip() - if not line: + if line: ls_filenames.append(line) return {"packages": " ".join(ls_filenames)} @@ -444,7 +444,7 @@ def dockerfile(props: IProperties) -> str: # checks if the list of files is empty -def hasFiles(step: BuildStep) -> bool: +def hasPackagesGenerated(step: BuildStep) -> bool: return len(step.getProperty("packages")) >= 1