Module: tools Branch: master Commit: 149fa941475070ab88119ecd12462bf4741d1b71 URL: http://source.winehq.org/git/tools.git/?a=commit;h=149fa941475070ab88119ecd1...
Author: Francois Gouget fgouget@codeweavers.com Date: Mon Nov 13 17:06:56 2017 +0100
Revert "Add retrieve of test data files".
The TestBot never creates a TestFiles.zip file in the Task directory so this is dead code. Also there is no plan to make use of that functionality so the code can be removed.
This reverts commit 04a67fce26fb2fed64777239594c9c20ef56e6d7.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/web/GetFile.pl | 40 +++++++--------------------------------- testbot/web/JobDetails.pl | 11 ----------- 2 files changed, 7 insertions(+), 44 deletions(-)
diff --git a/testbot/web/GetFile.pl b/testbot/web/GetFile.pl index 4c6e1e2..54d4c4b 100644 --- a/testbot/web/GetFile.pl +++ b/testbot/web/GetFile.pl @@ -28,7 +28,7 @@ use WineTestBot::Steps;
sub GetFile($$$$) { - my ($Request, $JobKey, $StepKey, $TaskKey) = @_; + my ($Request, $JobKey, $StepKey) = @_;
# Validate and untaint if (! ($JobKey =~ m/^(\d+)$/)) @@ -41,18 +41,6 @@ sub GetFile($$$$) return !1; } $StepKey = $1; - if (! defined($TaskKey)) - { - $TaskKey = undef; - } - elsif ($TaskKey =~ m/^(\d+)$/) - { - $TaskKey = $1; - } - else - { - return !1; - }
my $Job = CreateJobs()->GetItem($JobKey); if (! defined($Job)) @@ -65,9 +53,7 @@ sub GetFile($$$$) return !1; }
- my $FileName = "$DataDir/jobs/$JobKey/$StepKey/" . - (defined($TaskKey) ? "$TaskKey/TestFiles.zip" : - $Step->FileName); + my $FileName = "$DataDir/jobs/$JobKey/$StepKey/" . $Step->FileName; if (! sysopen(FILE, $FileName, O_RDONLY)) { return !1; @@ -100,21 +86,10 @@ sub GetFile($$$$) # HTTP/1.0 $Request->headers_out->add("Pragma", "no-cache");
- if (defined($TaskKey)) - { - # Zip file - $Request->content_type("application/zip"); - $Request->headers_out->add("Content-Disposition", - 'attachment; filename="TestFiles.zip"'); - } - else - { - # Binary file - $Request->content_type("application/octet-stream"); - $Request->headers_out->add("Content-Disposition", - 'attachment; filename="' . $Step->FileName . - '"'); - } + # Binary file + $Request->content_type("application/octet-stream"); + $Request->headers_out->add("Content-Disposition", + 'attachment; filename="' . $Step->FileName . '"');
print $ImageBytes;
@@ -126,8 +101,7 @@ my $Request = shift; my $CGIObj = CGI->new($Request); my $JobKey = $CGIObj->param("JobKey"); my $StepKey = $CGIObj->param("StepKey"); -my $TaskKey = $CGIObj->param("TaskKey"); -if (! GetFile($Request, $JobKey, $StepKey, $TaskKey)) +if (! GetFile($Request, $JobKey, $StepKey)) { $Request->headers_out->set("Location", "/"); $Request->status(Apache2::Const::REDIRECT); diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index c5803ed..a4ed994 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -322,17 +322,6 @@ sub GenerateBody($) "'>Show full log</a></div>\n"; } } - my $TestFilesName = "$TaskDir/TestFiles.zip"; - if (-r $TestFilesName) - { - my $URI = "/GetFile.pl?JobKey=" . uri_escape($self->{JobId}) . - "&StepKey=" . uri_escape($Item->StepNo) . - "&TaskKey=" . uri_escape($Item->TaskNo); - print "<div class='TaskMoreInfoLink'><a href='" . - $self->CGI->escapeHTML($URI) . - "'>Retrieve test files</a></div>\n"; - } - print "</div>\n"; if (open LOGFILE, "<$LogName") {