Module: tools Branch: master Commit: 189e1b20004e2014c3009638a7f1a199837e7dec URL: https://source.winehq.org/git/tools.git/?a=commit;h=189e1b20004e2014c3009638...
Author: Francois Gouget fgouget@codeweavers.com Date: Tue Jan 21 12:07:05 2020 +0100
testbot/Submit: Ensure the staged patch can be cleaned up if submit fails.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/bin/Janitor.pl | 2 +- testbot/web/Submit.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl index f78c75d..121a3a6 100755 --- a/testbot/bin/Janitor.pl +++ b/testbot/bin/Janitor.pl @@ -271,7 +271,7 @@ if (opendir(my $dh, "$DataDir/staging")) my $Age = int((-M $FileName) + 0.5); my $TTL = $JobPurgeDays ? $JobPurgeDays - $Age : undef;
- if ($Entry =~ /^[0-9a-f]{32}-websubmit_/) + if ($Entry =~ /^[0-9a-f]{32}-websubmit2?_/) { # These files always expire after one day $TTL = 1 - $Age; diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl index bd3dc9f..1943b42 100644 --- a/testbot/web/Submit.pl +++ b/testbot/web/Submit.pl @@ -1292,7 +1292,7 @@ sub OnSubmit($) # Rename the staging file to avoid race conditions if the user clicks on # Submit multiple times my $OldStaging = $self->_GetStagingFilePath(); - my $Staging = CreateNewLink($OldStaging, "$DataDir/staging", $self->{FileName}); + my $Staging = CreateNewLink($OldStaging, "$DataDir/staging", "-websubmit2_$self->{FileName}"); if (!defined $Staging) { $self->{ErrMessage} = "Could not rename '$self->{FileName}': $!";