| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 | 39 |
| 40 _log = logging.getLogger(__name__) | 40 _log = logging.getLogger(__name__) |
| 41 | 41 |
| 42 | 42 |
| 43 class LinuxPort(base.Port): | 43 class LinuxPort(base.Port): |
| 44 port_name = 'linux' | 44 port_name = 'linux' |
| 45 | 45 |
| 46 SUPPORTED_VERSIONS = ('x86', 'x86_64') | 46 SUPPORTED_VERSIONS = ('x86', 'x86_64') |
| 47 | 47 |
| 48 FALLBACK_PATHS = { 'x86_64': [ 'linux' ] + win.WinPort.latest_platform_fallb
ack_path() } | 48 FALLBACK_PATHS = {'x86_64': ['linux'] + win.WinPort.latest_platform_fallback
_path()} |
| 49 FALLBACK_PATHS['x86'] = ['linux-x86'] + FALLBACK_PATHS['x86_64'] | 49 FALLBACK_PATHS['x86'] = ['linux-x86'] + FALLBACK_PATHS['x86_64'] |
| 50 | 50 |
| 51 DEFAULT_BUILD_DIRECTORIES = ('out',) | 51 DEFAULT_BUILD_DIRECTORIES = ('out',) |
| 52 | 52 |
| 53 BUILD_REQUIREMENTS_URL = 'https://code.google.com/p/chromium/wiki/LinuxBuild
Instructions' | 53 BUILD_REQUIREMENTS_URL = 'https://code.google.com/p/chromium/wiki/LinuxBuild
Instructions' |
| 54 | 54 |
| 55 @classmethod | 55 @classmethod |
| 56 def _determine_driver_path_statically(cls, host, options): | 56 def _determine_driver_path_statically(cls, host, options): |
| 57 config_object = config.Config(host.executive, host.filesystem) | 57 config_object = config.Config(host.executive, host.filesystem) |
| 58 build_directory = getattr(options, 'build_directory', None) | 58 build_directory = getattr(options, 'build_directory', None) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 # We don't know what the architecture is; default to 'x86' because | 85 # We don't know what the architecture is; default to 'x86' because |
| 86 # maybe we're rebaselining and the binary doesn't actually exist, | 86 # maybe we're rebaselining and the binary doesn't actually exist, |
| 87 # or something else weird is going on. It's okay to do this because | 87 # or something else weird is going on. It's okay to do this because |
| 88 # if we actually try to use the binary, check_build() should fail. | 88 # if we actually try to use the binary, check_build() should fail. |
| 89 return 'x86_64' | 89 return 'x86_64' |
| 90 | 90 |
| 91 @classmethod | 91 @classmethod |
| 92 def determine_full_port_name(cls, host, options, port_name): | 92 def determine_full_port_name(cls, host, options, port_name): |
| 93 if port_name.endswith('linux'): | 93 if port_name.endswith('linux'): |
| 94 return port_name + '-' + cls._determine_architecture(host.filesystem
, host.executive, cls._determine_driver_path_statically(host, options)) | 94 return port_name + '-' + \ |
| 95 cls._determine_architecture(host.filesystem, host.executive, cls
._determine_driver_path_statically(host, options)) |
| 95 return port_name | 96 return port_name |
| 96 | 97 |
| 97 def __init__(self, host, port_name, **kwargs): | 98 def __init__(self, host, port_name, **kwargs): |
| 98 super(LinuxPort, self).__init__(host, port_name, **kwargs) | 99 super(LinuxPort, self).__init__(host, port_name, **kwargs) |
| 99 (base, arch) = port_name.rsplit('-', 1) | 100 (base, arch) = port_name.rsplit('-', 1) |
| 100 assert base == 'linux' | 101 assert base == 'linux' |
| 101 assert arch in self.SUPPORTED_VERSIONS | 102 assert arch in self.SUPPORTED_VERSIONS |
| 102 assert port_name in ('linux', 'linux-x86', 'linux-x86_64') | 103 assert port_name in ('linux', 'linux-x86', 'linux-x86_64') |
| 103 self._version = 'lucid' # We only support lucid right now. | 104 self._version = 'lucid' # We only support lucid right now. |
| 104 self._architecture = arch | 105 self._architecture = arch |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 self._dump_reader.clobber_old_results() | 138 self._dump_reader.clobber_old_results() |
| 138 | 139 |
| 139 def operating_system(self): | 140 def operating_system(self): |
| 140 return 'linux' | 141 return 'linux' |
| 141 | 142 |
| 142 # | 143 # |
| 143 # PROTECTED METHODS | 144 # PROTECTED METHODS |
| 144 # | 145 # |
| 145 | 146 |
| 146 def _check_apache_install(self): | 147 def _check_apache_install(self): |
| 147 result = self._check_file_exists(self.path_to_apache(), "apache2") | 148 result = self._check_file_exists(self.path_to_apache(), 'apache2') |
| 148 result = self._check_file_exists(self.path_to_apache_config_file(), "apa
che2 config file") and result | 149 result = self._check_file_exists(self.path_to_apache_config_file(), 'apa
che2 config file') and result |
| 149 if not result: | 150 if not result: |
| 150 _log.error(' Please install using: "sudo apt-get install apache2
libapache2-mod-php5"') | 151 _log.error(' Please install using: "sudo apt-get install apache2
libapache2-mod-php5"') |
| 151 _log.error('') | 152 _log.error('') |
| 152 return result | 153 return result |
| 153 | 154 |
| 154 def _wdiff_missing_message(self): | 155 def _wdiff_missing_message(self): |
| 155 return 'wdiff is not installed; please install using "sudo apt-get insta
ll wdiff"' | 156 return 'wdiff is not installed; please install using "sudo apt-get insta
ll wdiff"' |
| 156 | 157 |
| 157 def path_to_apache(self): | 158 def path_to_apache(self): |
| 158 # The Apache binary path can vary depending on OS and distribution | 159 # The Apache binary path can vary depending on OS and distribution |
| 159 # See http://wiki.apache.org/httpd/DistrosDefaultLayout | 160 # See http://wiki.apache.org/httpd/DistrosDefaultLayout |
| 160 for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]: | 161 for path in ['/usr/sbin/httpd', '/usr/sbin/apache2']: |
| 161 if self._filesystem.exists(path): | 162 if self._filesystem.exists(path): |
| 162 return path | 163 return path |
| 163 _log.error("Could not find apache. Not installed or unknown path.") | 164 _log.error('Could not find apache. Not installed or unknown path.') |
| 164 return None | 165 return None |
| 165 | 166 |
| 166 def _path_to_driver(self, configuration=None): | 167 def _path_to_driver(self, configuration=None): |
| 167 binary_name = self.driver_name() | 168 binary_name = self.driver_name() |
| 168 return self._build_path_with_configuration(configuration, binary_name) | 169 return self._build_path_with_configuration(configuration, binary_name) |
| 169 | 170 |
| 170 def _path_to_helper(self): | 171 def _path_to_helper(self): |
| 171 return None | 172 return None |
| OLD | NEW |