[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

ossy at webkit.org ossy at webkit.org
Wed Feb 10 22:11:38 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit d7eb6b60bc7a89928a7e6617e0aa4d1c7a101743
Author: ossy at webkit.org <ossy at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 4 00:32:28 2010 +0000

    Rubber-stamped by Eric Seidel.
    
    Roll out r53559 and r54084, because it might caused flakeyness on the Windows Test bots
    
    * Scripts/run-iexploder-tests:
    * Scripts/run-webkit-httpd:
    * Scripts/run-webkit-tests:
    * Scripts/webkitperl/httpd.pm: Removed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f11b7a4..89bf080 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,16 @@
 2010-02-03  Csaba Osztrogonác  <ossy at webkit.org>
 
+        Rubber-stamped by Eric Seidel.
+
+        Roll out r53559 and r54084, because it might caused flakeyness on the Windows Test bots
+
+        * Scripts/run-iexploder-tests:
+        * Scripts/run-webkit-httpd:
+        * Scripts/run-webkit-tests:
+        * Scripts/webkitperl/httpd.pm: Removed.
+
+2010-02-03  Csaba Osztrogonác  <ossy at webkit.org>
+
         Rubber-stamped by Ariya Hidayat.
 
         Roll back r53889 again, because roll out didn't solve flakeyness on the Windows Test bots
diff --git a/WebKitTools/Scripts/run-iexploder-tests b/WebKitTools/Scripts/run-iexploder-tests
index 1b3976f..ed5ecd6 100755
--- a/WebKitTools/Scripts/run-iexploder-tests
+++ b/WebKitTools/Scripts/run-iexploder-tests
@@ -38,17 +38,16 @@ use Getopt::Long;
 use IPC::Open2;
 
 use lib $FindBin::Bin;
-use webkitperl::httpd;
 use webkitdirs;
 
-sub configureAndOpenHTTPDIfNeeded();
+sub openHTTPDIfNeeded();
+sub closeHTTPD();
 sub runSafariWithIExploder();
 
 # Argument handling
 my $guardMalloc = '';
 my $httpdPort = 8000;
 my $downloadTest;
-my $iExploderTestDirectory = "/tmp/iExploderTest";
 
 GetOptions(
     'guard-malloc|g' => \$guardMalloc,
@@ -64,8 +63,8 @@ chdirWebKit();
 
 checkFrameworks();
 
-my $isHttpdOpen = 0;
-configureAndOpenHTTPDIfNeeded();
+my $httpdOpen = 0;
+openHTTPDIfNeeded();
 
 if ($downloadTest) {
     system "/usr/bin/curl -o ~/Desktop/iexploder$downloadTest.html \"http://127.0.0.1:$httpdPort/iexploder.cgi?lookup=1&test=$downloadTest\"";
@@ -73,11 +72,11 @@ if ($downloadTest) {
 } else {
     runSafariWithIExploder();
     print "Last generated tests:\n";
-    system "grep 'iexploder.cgi' $iExploderTestDirectory/access_log.txt | tail -n -5 | awk -F'[ =&\\?]' '{if (\$8 == \"lookup\") print \$11; else print \$9}'";
+    system "grep 'iexploder.cgi' /tmp/WebKit/access_log.txt | tail -n -5 | awk -F'[ =&\\?]' '{if (\$8 == \"lookup\") print \$11; else print \$9}'";
 }
 
-rmtree $iExploderTestDirectory;
-$isHttpdOpen = !closeHTTPD();
+closeHTTPD();
+
 
 sub runSafariWithIExploder()
 {
@@ -88,7 +87,7 @@ sub runSafariWithIExploder()
         $redirectTo = "http://127.0.0.1:$httpdPort/index.html";
     }
 
-    open REDIRECT_HTML, ">", "$iExploderTestDirectory/redirect.html" or die;
+    open REDIRECT_HTML, ">", "/tmp/WebKit/redirect.html" or die;
     print REDIRECT_HTML "<html>\n";
     print REDIRECT_HTML "    <head>\n";
     print REDIRECT_HTML "        <meta http-equiv=\"refresh\" content=\"1;URL=$redirectTo\" />\n";
@@ -103,17 +102,35 @@ sub runSafariWithIExploder()
     
     local %ENV;
     $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
-    system "WebKitTools/Scripts/run-safari", "-NSOpen", "$iExploderTestDirectory/redirect.html";
+    system "WebKitTools/Scripts/run-safari", "-NSOpen", "/tmp/WebKit/redirect.html";
 }
 
-sub configureAndOpenHTTPDIfNeeded()
+sub openHTTPDIfNeeded()
 {
-    return if $isHttpdOpen;
-    mkdir $iExploderTestDirectory;
-    my $httpdPath = getHTTPDPath();
-    my $webkitDirectory = getcwd();
-    my $testDirectory = $webkitDirectory . "/LayoutTests";
-    my $iExploderDirectory = $webkitDirectory . "/WebKitTools/iExploder";
+    return if $httpdOpen;
+
+    mkdir "/tmp/WebKit";
+    
+    if (-f "/tmp/WebKit/httpd.pid") {
+        my $oldPid = `cat /tmp/WebKit/httpd.pid`;
+        chomp $oldPid;
+        if (0 != kill 0, $oldPid) {
+            print "\nhttpd is already running: pid $oldPid, killing...\n";
+            kill 15, $oldPid;
+            
+            my $retryCount = 20;
+            while ((0 != kill 0, $oldPid) && $retryCount) {
+                sleep 1;
+                --$retryCount;
+            }
+            
+            die "Timed out waiting for httpd to quit" unless $retryCount;
+        }
+    }
+    
+    my $testDirectory = getcwd() . "/LayoutTests";
+    my $iExploderDirectory = getcwd() . "/WebKitTools/iExploder";
+    my $httpdPath = "/usr/sbin/httpd";
     my $httpdConfig = "$testDirectory/http/conf/httpd.conf";
     $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
     my $documentRoot = "$iExploderDirectory/htdocs";
@@ -121,18 +138,36 @@ sub configureAndOpenHTTPDIfNeeded()
     my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
     my $listen = "127.0.0.1:$httpdPort";
 
-
-    my @args = (
+    open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath, 
         "-f", "$httpdConfig",
         "-C", "DocumentRoot \"$documentRoot\"",
         "-C", "Listen $listen",
         "-c", "TypesConfig \"$typesConfig\"",
-        "-c", "CustomLog \"$iExploderTestDirectory/access_log.txt\" common",
-        "-c", "ErrorLog \"$iExploderTestDirectory/error_log.txt\"",
+        "-c", "CustomLog \"/tmp/WebKit/access_log.txt\" common",
+        "-c", "ErrorLog \"/tmp/WebKit/error_log.txt\"",
         "-c", "SSLCertificateFile \"$sslCertificate\"",
         # Apache wouldn't run CGIs with permissions==700 otherwise
-        "-c", "User \"#$<\""
-    );
+        "-c", "User \"#$<\"");
+
+    my $retryCount = 20;
+    while (system("/usr/bin/curl -q --silent --stderr - --output " . File::Spec->devnull() . " $listen") && $retryCount) {
+        sleep 1;
+        --$retryCount;
+    }
+    
+    die "Timed out waiting for httpd to start" unless $retryCount;
+    
+    $httpdOpen = 1;
+}
+
+sub closeHTTPD()
+{
+    return if !$httpdOpen;
+
+    close HTTPDIN;
+    close HTTPDOUT;
+
+    kill 15, `cat /tmp/WebKit/httpd.pid` if -f "/tmp/WebKit/httpd.pid";
 
-    $isHttpdOpen = openHTTPD(@args);
+    $httpdOpen = 0;
 }
diff --git a/WebKitTools/Scripts/run-webkit-httpd b/WebKitTools/Scripts/run-webkit-httpd
index 018f64c..9a97190 100755
--- a/WebKitTools/Scripts/run-webkit-httpd
+++ b/WebKitTools/Scripts/run-webkit-httpd
@@ -33,13 +33,11 @@ use strict;
 use warnings;
 
 use Cwd;
-use File::Path;
 use File::Basename;
 use Getopt::Long;
 use FindBin;
 
 use lib $FindBin::Bin;
-use webkitperl::httpd;
 use webkitdirs;
 
 # Argument handling
@@ -64,7 +62,39 @@ if (!$result || @ARGV || $showHelp) {
 setConfiguration();
 my $productDir = productDir();
 chdirWebKit();
-my $testDirectory = File::Spec->catfile(getcwd(), "LayoutTests");
+
+mkdir "/tmp/WebKit";
+
+if (-f "/tmp/WebKit/httpd.pid") {
+    my $oldPid = `cat /tmp/WebKit/httpd.pid`;
+    chomp $oldPid;
+    if (0 != kill 0, $oldPid) {
+        print "\nhttpd is already running: pid $oldPid, killing...\n";
+        kill 15, $oldPid;
+        
+        my $retryCount = 20;
+        while ((0 != kill 0, $oldPid) && $retryCount) {
+            sleep 1;
+            --$retryCount;
+        }
+        
+        die "Timed out waiting for httpd to quit" unless $retryCount;
+    }
+}
+
+my $testDirectory = getcwd() . "/LayoutTests";
+my $jsTestResourcesDirectory = $testDirectory . "/fast/js/resources";
+my $httpdPath = "/usr/sbin/httpd";
+$httpdPath = "/usr/sbin/apache2" if isDebianBased();
+my $httpdConfig = "$testDirectory/http/conf/httpd.conf";
+$httpdConfig = "$testDirectory/http/conf/cygwin-httpd.conf" if isCygwin();
+$httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+$httpdConfig = "$testDirectory/http/conf/apache2-debian-httpd.conf" if isDebianBased();
+$httpdConfig = "$testDirectory/http/conf/fedora-httpd.conf" if isFedoraBased();
+my $documentRoot = "$testDirectory/http/tests";
+my $typesConfig = "$testDirectory/http/conf/mime.types";
+my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
+
 my $listen = "127.0.0.1:$httpdPort";
 $listen = "$httpdPort" if ($allInterfaces);
 
@@ -73,13 +103,19 @@ if ($allInterfaces) {
 } else {
     print "Starting httpd on <http://$listen/>...\n";
 }
-setShouldWaitForUserInterrupt();
 print "Press Ctrl+C to stop it.\n\n";
 
 my @args = (
+    "-f", "$httpdConfig",
+    "-C", "DocumentRoot \"$documentRoot\"",
+    # Setup a link to where the js test templates are stored, use -c so that mod_alias will already be laoded.
+    "-c", "Alias /js-test-resources \"$jsTestResourcesDirectory\"",
     "-C", "Listen $listen",
+    "-c", "TypesConfig \"$typesConfig\"",
     "-c", "CustomLog |/usr/bin/tee common",
     "-c", "ErrorLog |/usr/bin/tee",
+    # Apache wouldn't run CGIs with permissions==700 otherwise.
+    "-c", "User \"#$<\"",
     # Run in single-process mode, do not detach from the controlling terminal.
     "-X",
     # Disable Keep-Alive support. Makes testing in multiple browsers easier (no need to wait
@@ -87,6 +123,9 @@ my @args = (
     "-c", "KeepAlive 0"
 );
 
-my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
- at args = (@defaultArgs, @args);
-openHTTPD(@args);
+# FIXME: Enable this on Windows once <rdar://problem/5345985> is fixed
+push(@args, "-c", "SSLCertificateFile \"$sslCertificate\"") unless isCygwin();
+
+system($httpdPath, @args);
+
+unlink "/tmp/WebKit/httpd.pid";
diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests
index bb4fb34..e80326e 100755
--- a/WebKitTools/Scripts/run-webkit-tests
+++ b/WebKitTools/Scripts/run-webkit-tests
@@ -67,7 +67,6 @@ use Time::HiRes qw(time usleep);
 use List::Util 'shuffle';
 
 use lib $FindBin::Bin;
-use webkitperl::httpd;
 use webkitdirs;
 use VCSUtils;
 use POSIX;
@@ -76,8 +75,8 @@ sub buildPlatformResultHierarchy();
 sub buildPlatformTestHierarchy(@);
 sub closeCygpaths();
 sub closeDumpTool();
+sub closeHTTPD();
 sub closeWebSocketServer();
-sub configureAndOpenHTTPDIfNeeded();
 sub countAndPrintLeaks($$$);
 sub countFinishedTest($$$$);
 sub deleteExpectedAndActualResults($);
@@ -92,6 +91,7 @@ sub resolveAndMakeTestResultsDirectory();
 sub numericcmp($$);
 sub openDiffTool();
 sub openDumpTool();
+sub openHTTPDIfNeeded();
 sub parseLeaksandPrintUniqueLeaks();
 sub openWebSocketServerIfNeeded();
 sub pathcmp($$);
@@ -143,8 +143,7 @@ my $showHelp = 0;
 my $stripEditingCallbacks = isCygwin();
 my $testHTTP = 1;
 my $testMedia = 1;
-my $tmpDir = "/tmp";
-my $testResultsDirectory = File::Spec->catfile($tmpDir, "layout-test-results");
+my $testResultsDirectory = "/tmp/layout-test-results";
 my $testsPerDumpTool = 1000;
 my $threaded = 0;
 # DumpRenderTree has an internal timeout of 15 seconds, so this must be > 15.
@@ -384,8 +383,7 @@ my @platformTestHierarchy = buildPlatformTestHierarchy(@platformResultHierarchy)
 
 $expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitExpectedTestResultsDirectory"};
 
-$testResultsDirectory = File::Spec->rel2abs($testResultsDirectory);
-my $testResults = File::Spec->catfile($testResultsDirectory, "results.html");
+my $testResults = catfile($testResultsDirectory, "results.html");
 
 print "Running tests from $testDirectory\n";
 if ($pixelTests) {
@@ -607,7 +605,7 @@ for my $test (@tests) {
     }
 
     if ($test =~ /^http\//) {
-        configureAndOpenHTTPDIfNeeded();
+        openHTTPDIfNeeded();
         if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/wml\// && $test !~ /^http\/tests\/media\//) {
             my $path = canonpath($test);
             $path =~ s/^http\/tests\///;
@@ -947,7 +945,7 @@ printf "\n%0.2fs total testing time\n", (time - $overallStartTime) . "";
 
 !$isDumpToolOpen || die "Failed to close $dumpToolName.\n";
 
-$isHttpdOpen = !closeHTTPD();
+closeHTTPD();
 closeWebSocketServer();
 
 # Because multiple instances of this script are running concurrently we cannot 
@@ -1347,21 +1345,95 @@ sub dumpToolDidCrash()
     return DumpRenderTreeSupport::processIsCrashing($dumpToolPID);
 }
 
-sub configureAndOpenHTTPDIfNeeded()
+sub openHTTPDIfNeeded()
 {
     return if $isHttpdOpen;
-    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
+
+    mkdir "/tmp/WebKit";
+    
+    if (-f "/tmp/WebKit/httpd.pid") {
+        my $oldPid = `cat /tmp/WebKit/httpd.pid`;
+        chomp $oldPid;
+        if (0 != kill 0, $oldPid) {
+            print "\nhttpd is already running: pid $oldPid, killing...\n";
+            kill 15, $oldPid;
+            
+            my $retryCount = 20;
+            while ((0 != kill 0, $oldPid) && $retryCount) {
+                sleep 1;
+                --$retryCount;
+            }
+            
+            die "Timed out waiting for httpd to quit" unless $retryCount;
+        }
+    }
+    
+    my $httpdPath = "/usr/sbin/httpd";
+    my $httpdConfig;
+    if (isCygwin()) {
+        my $windowsConfDirectory = "$testDirectory/http/conf/";
+        unless (-x "/usr/lib/apache/libphp4.dll") {
+            copy("$windowsConfDirectory/libphp4.dll", "/usr/lib/apache/libphp4.dll");
+            chmod(0755, "/usr/lib/apache/libphp4.dll");
+        }
+        $httpdConfig = "$windowsConfDirectory/cygwin-httpd.conf";
+    } elsif (isDebianBased()) {
+        $httpdPath = "/usr/sbin/apache2";
+        $httpdConfig = "$testDirectory/http/conf/apache2-debian-httpd.conf";
+    } elsif (isFedoraBased()) {
+        $httpdPath = "/usr/sbin/httpd";
+        $httpdConfig = "$testDirectory/http/conf/fedora-httpd.conf";
+    } else {
+        $httpdConfig = "$testDirectory/http/conf/httpd.conf";
+        $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+    }
+    my $documentRoot = "$testDirectory/http/tests";
+    my $jsTestResourcesDirectory = $testDirectory . "/fast/js/resources";
+    my $typesConfig = "$testDirectory/http/conf/mime.types";
     my $listen = "127.0.0.1:$httpdPort";
+    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
+    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
+
     my @args = (
+        "-f", "$httpdConfig",
+        "-C", "DocumentRoot \"$documentRoot\"",
+        # Setup a link to where the js test templates are stored, use -c so that mod_alias will already be laoded.
+        "-c", "Alias /js-test-resources \"$jsTestResourcesDirectory\"",
+        "-C", "Listen $listen",
+        "-c", "TypesConfig \"$typesConfig\"",
         "-c", "CustomLog \"$absTestResultsDirectory/access_log.txt\" common",
         "-c", "ErrorLog \"$absTestResultsDirectory/error_log.txt\"",
-        "-C", "Listen $listen"
+        # Apache wouldn't run CGIs with permissions==700 otherwise
+        "-c", "User \"#$<\""
     );
 
-    my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
-    @args = (@defaultArgs, @args);
+    # FIXME: Enable this on Windows once <rdar://problem/5345985> is fixed
+    # The version of Apache we use with Cygwin does not support SSL
+    push(@args, "-c", "SSLCertificateFile \"$sslCertificate\"") unless isCygwin();
+
+    open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath, @args);
+
+    my $retryCount = 20;
+    while (system("/usr/bin/curl -q --silent --stderr - --output " . File::Spec->devnull() . " $listen") && $retryCount) {
+        sleep 1;
+        --$retryCount;
+    }
+    
+    die "Timed out waiting for httpd to start" unless $retryCount;
+    
+    $isHttpdOpen = 1;
+}
+
+sub closeHTTPD()
+{
+    return if !$isHttpdOpen;
+
+    close HTTPDIN;
+    close HTTPDOUT;
+
+    kill 15, `cat /tmp/WebKit/httpd.pid` if -f "/tmp/WebKit/httpd.pid";
 
-    $isHttpdOpen = openHTTPD(@args);
+    $isHttpdOpen = 0;
 }
 
 sub openWebSocketServerIfNeeded()
diff --git a/WebKitTools/Scripts/webkitperl/httpd.pm b/WebKitTools/Scripts/webkitperl/httpd.pm
deleted file mode 100644
index d082870..0000000
--- a/WebKitTools/Scripts/webkitperl/httpd.pm
+++ /dev/null
@@ -1,202 +0,0 @@
-# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved
-# Copyright (C) 2006 Alexey Proskuryakov (ap at nypop.com)
-# Copyright (C) 2010 Andras Becsi (abecsi at inf.u-szeged.hu), University of Szeged
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Module to share code to start and stop the Apache daemon.
-
-use strict;
-use warnings;
-
-use File::Path;
-use File::Spec;
-use File::Spec::Functions;
-use IPC::Open2;
-
-use webkitdirs;
-
-BEGIN {
-   use Exporter   ();
-   our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-   $VERSION     = 1.00;
-   @ISA         = qw(Exporter);
-   @EXPORT      = qw(&getHTTPDPath &getDefaultConfigForTestDirectory &openHTTPD &closeHTTPD &getHTTPDPid &setShouldWaitForUserInterrupt);
-   %EXPORT_TAGS = ( );
-   @EXPORT_OK   = ();
-}
-
-my $tmpDir = "/tmp";
-my $httpdPath;
-my $httpdPidDir = File::Spec->catfile($tmpDir, "WebKit");
-my $httpdPidFile = File::Spec->catfile($httpdPidDir, "httpd.pid");
-my $httpdPid;
-my $waitForUserInterrupt = 0;
-
-$SIG{'INT'} = 'cleanup';
-$SIG{'TERM'} = 'cleanup';
-
-sub getHTTPDPath
-{
-    if (isDebianBased()) {
-        $httpdPath = "/usr/sbin/apache2";
-    } else {
-        $httpdPath = "/usr/sbin/httpd";
-    }
-    return $httpdPath;
-}
-
-sub getDefaultConfigForTestDirectory
-{
-    my ($testDirectory) = @_;
-    die "No test directory has been specified." unless ($testDirectory);
-
-    my $httpdConfig;
-    getHTTPDPath();
-    if (isCygwin()) {
-        my $windowsConfDirectory = "$testDirectory/http/conf/";
-        unless (-x "/usr/lib/apache/libphp4.dll") {
-            copy("$windowsConfDirectory/libphp4.dll", "/usr/lib/apache/libphp4.dll");
-            chmod(0755, "/usr/lib/apache/libphp4.dll");
-        }
-        $httpdConfig = "$windowsConfDirectory/cygwin-httpd.conf";
-    } elsif (isDebianBased()) {
-        $httpdConfig = "$testDirectory/http/conf/apache2-debian-httpd.conf";
-    } elsif (isFedoraBased()) {
-        $httpdConfig = "$testDirectory/http/conf/fedora-httpd.conf";
-    } else {
-        $httpdConfig = "$testDirectory/http/conf/httpd.conf";
-        $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
-    }
-
-    my $documentRoot = "$testDirectory/http/tests";
-    my $jsTestResourcesDirectory = $testDirectory . "/fast/js/resources";
-    my $typesConfig = "$testDirectory/http/conf/mime.types";
-    my $httpdLockFile = File::Spec->catfile($httpdPidDir, "httpd.lock");
-    my $httpdScoreBoardFile = File::Spec->catfile($httpdPidDir, "httpd.scoreboard");
-
-    my @httpdArgs = (
-        "-f", "$httpdConfig",
-        "-C", "DocumentRoot \"$documentRoot\"",
-        # Setup a link to where the js test templates are stored, use -c so that mod_alias will already be loaded.
-        "-c", "Alias /js-test-resources \"$jsTestResourcesDirectory\"",
-        "-c", "TypesConfig \"$typesConfig\"",
-        # Apache wouldn't run CGIs with permissions==700 otherwise
-        "-c", "User \"#$<\"",
-        "-c", "LockFile \"$httpdLockFile\"",
-        "-c", "PidFile \"$httpdPidFile\"",
-        "-c", "ScoreBoardFile \"$httpdScoreBoardFile\"",
-    );
-
-    # FIXME: Enable this on Windows once <rdar://problem/5345985> is fixed
-    # The version of Apache we use with Cygwin does not support SSL
-    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
-    push(@httpdArgs, "-c", "SSLCertificateFile \"$sslCertificate\"") unless isCygwin();
-
-    return @httpdArgs;
-
-}
-
-sub openHTTPD(@)
-{
-    my (@args) = @_;
-    die "No HTTPD configuration has been specified" unless (@args);
-    mkdir($httpdPidDir, 0755);
-    die "No write permissions to $httpdPidDir" unless (-w $httpdPidDir);
-
-    if (-f $httpdPidFile) {
-        open (PIDFILE, $httpdPidFile);
-        my $oldPid = <PIDFILE>;
-        chomp $oldPid;
-        close PIDFILE;
-        if (0 != kill 0, $oldPid) {
-            print "\nhttpd is already running: pid $oldPid, killing...\n";
-            kill 15, $oldPid;
-
-            my $retryCount = 20;
-            while ((kill(0, $oldPid) != 0) && $retryCount) {
-                sleep 1;
-                --$retryCount;
-            }
-
-            die "Timed out waiting for httpd to quit" unless $retryCount;
-        }
-    }
-
-    $httpdPath = "/usr/sbin/httpd" unless ($httpdPath);
-
-    open2(">&1", \*HTTPDIN, $httpdPath, @args);
-
-    my $retryCount = 20;
-    while (!-f $httpdPidFile && $retryCount) {
-        sleep 1;
-        --$retryCount;
-    }
-
-    if (!$retryCount) {
-        rmtree $httpdPidDir;
-        die "Timed out waiting for httpd to start";
-    }
-
-    $httpdPid = <PIDFILE> if open(PIDFILE, $httpdPidFile);
-    chomp $httpdPid if $httpdPid;
-    close PIDFILE;
-
-    waitpid($httpdPid, 0) if ($waitForUserInterrupt && $httpdPid);
-
-    return 1;
-}
-
-sub closeHTTPD
-{
-    close HTTPDIN;
-    if ($httpdPid) {
-        kill 15, $httpdPid;
-        my $retryCount = 20;
-        while (-f $httpdPidFile && $retryCount) {
-            sleep 1;
-            --$retryCount;
-        }
-
-        if (!$retryCount) {
-            print STDERR "Timed out waiting for httpd to terminate!\n";
-            return 0;
-        }
-    }
-    rmdir $httpdPidDir;
-    return 1;
-}
-
-sub setShouldWaitForUserInterrupt
-{
-    $waitForUserInterrupt = 1;
-}
-
-sub cleanup
-{
-    closeHTTPD();
-    print "\n";
-    exit(1);
-}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list