[Tools] testbot: Always create the Task directory even if there is nothing to stage.
Francois Gouget <[email protected]> Wed, 22 Nov 2017 11:24:33 +0100 (CET)
| Newsgroups | gmane.comp.emulators.wine.patches |
|---|---|
| Message-ID | <E1eHSCn-0005uL-Pg@amboise> |
Otherwise the Engine will have nowhere to put the error log when forking the Task's child process. This particularly impacts the Reconfig Tasks since they neither have a patch nor executable to stage. Signed-off-by: Francois Gouget <[email protected]> --- testbot/lib/WineTestBot/Steps.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm index 8c5d4ec8..95c0a45a 100644 --- a/testbot/lib/WineTestBot/Steps.pm +++ b/testbot/lib/WineTestBot/Steps.pm @@ -87,10 +87,9 @@ sub HandleStaging($$) { my ($self) = @_; - if (! $self->InStaging) - { - return undef; - } + # Always at least create the step's directory + my $StepDir = $self->CreateDir(); + return undef if (! $self->InStaging); my $FileName = $self->FileName; if ($FileName !~ m/^[0-9a-z-]+_(.*)$/) @@ -99,9 +98,7 @@ sub HandleStaging($$) } my $BaseName = $1; my $StagingFileName = "$DataDir/staging/$FileName"; - my $StepDir = $self->CreateDir(); - my $FinalFileName = "$StepDir/$BaseName"; - if (!move($StagingFileName, $FinalFileName)) + if (!move($StagingFileName, "$StepDir/$BaseName")) { return "Could not move the staging file: $!"; } -- 2.14.2