Chromium Code Reviews| Index: Tools/Scripts/webkitpy/layout_tests/port/base.py |
| diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py |
| index 8cd2a119d7ad2bc24395119909ad50a0a056c120..343426e52949f9ad6b62ab324491576cbe7bd6af 100644 |
| --- a/Tools/Scripts/webkitpy/layout_tests/port/base.py |
| +++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py |
| @@ -1441,7 +1441,7 @@ class Port(object): |
| raise IOError('%s was not found on the system' % config_file_from_env) |
| return config_file_from_env |
| - config_file_name = self._apache_config_file_name_for_platform(sys.platform) |
| + config_file_name = self._apache_config_file_name_for_platform() |
| return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_file_name) |
| # |
| @@ -1451,26 +1451,20 @@ class Port(object): |
| # or any of its subclasses. |
| # |
| - # FIXME: This belongs on some platform abstraction instead of Port. |
| - def _is_redhat_based(self): |
| - return self._filesystem.exists('/etc/redhat-release') |
| - |
| - def _is_debian_based(self): |
| - return self._filesystem.exists('/etc/debian_version') |
| - |
| def _apache_version(self): |
| config = self._executive.run_command([self.path_to_apache(), '-v']) |
| return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'\1', config) |
| - # We pass sys_platform into this method to make it easy to unit test. |
| - def _apache_config_file_name_for_platform(self, sys_platform): |
| - if sys_platform == 'cygwin': |
| + def _apache_config_file_name_for_platform(self): |
| + if self.host.platform.is_cygwin(): |
| return 'cygwin-httpd.conf' # CYGWIN is the only platform to still use Apache 1.3. |
| - if sys_platform.startswith('linux'): |
| - if self._is_redhat_based(): |
| - return 'fedora-httpd-' + self._apache_version() + '.conf' |
| - if self._is_debian_based(): |
| - return 'debian-httpd-' + self._apache_version() + '.conf' |
| + if self.host.platform.is_linux(): |
| + distribution = self.host.platform.linux_distribution() |
| + |
| + custom_configuration_distributions = ['arch', 'debian', 'redhat'] |
| + if distribution in custom_configuration_distributions: |
| + return "%s-httpd-%s.conf" % (distribution, self._apache_version()) |
| + |
| # All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and prior, which we no longer support). |
|
Dirk Pranke
2015/06/22 22:58:05
Can you delete line 1468 while you're at it; we do
|
| return 'apache2-httpd-' + self._apache_version() + '.conf' |