From ea5775a23e5223026b37100d23229b1bfc39bafa Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 4 Nov 2016 16:19:35 +0100 Subject: commands: allow to fall back to error reason if stderr is empty Use this in PristineTar and SrcRpmFile to give better error messages if the command doesn't even get to print to stderr (i.e. missing on disk). Closes: #842592 --- gbp/command_wrappers.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gbp/command_wrappers.py') diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py index e16c1080..f4b00b89 100644 --- a/gbp/command_wrappers.py +++ b/gbp/command_wrappers.py @@ -140,8 +140,10 @@ class Command(object): """ stdout = self.stdout.rstrip() if self.stdout else self.stdout stderr = self.stderr.rstrip() if self.stderr else self.stderr + stderr_or_reason = self.stderr.rstrip() if self.stderr else self.err_reason return self.run_error.format(stdout=stdout, stderr=stderr, + stderr_or_reason=stderr_or_reason, err_reason=self.err_reason) def __call__(self, args=[], quiet=False): -- cgit v1.2.3