- Revision
- 133414
- Author
- [email protected]
- Date
- 2012-11-04 01:03:03 -0700 (Sun, 04 Nov 2012)
Log Message
Unreviewed, rolling out r133381.
http://trac.webkit.org/changeset/133381
https://bugs.webkit.org/show_bug.cgi?id=101161
It made webkit-patch useless (Requested by Ossy_weekend on
Patch by Sheriff Bot <[email protected]> on 2012-11-04
* Scripts/webkitpy/common/system/autoinstall.py:
(AutoInstaller._create_scratch_directory):
(AutoInstaller._install):
(AutoInstaller.install):
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook.__init__):
(AutoinstallImportHook._install_pylint):
(AutoinstallImportHook._install_coverage):
(AutoinstallImportHook._install_eliza):
(AutoinstallImportHook._install):
* Scripts/webkitpy/thirdparty/__init___unittest.py:
(ThirdpartyTest.test_import_hook.MockImportHook.__init__):
(ThirdpartyTest.test_import_hook):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (133413 => 133414)
--- trunk/Tools/ChangeLog 2012-11-04 07:43:52 UTC (rev 133413)
+++ trunk/Tools/ChangeLog 2012-11-04 08:03:03 UTC (rev 133414)
@@ -1,3 +1,26 @@
+2012-11-04 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r133381.
+ http://trac.webkit.org/changeset/133381
+ https://bugs.webkit.org/show_bug.cgi?id=101161
+
+ It made webkit-patch useless (Requested by Ossy_weekend on
+ #webkit).
+
+ * Scripts/webkitpy/common/system/autoinstall.py:
+ (AutoInstaller._create_scratch_directory):
+ (AutoInstaller._install):
+ (AutoInstaller.install):
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ (AutoinstallImportHook.__init__):
+ (AutoinstallImportHook._install_pylint):
+ (AutoinstallImportHook._install_coverage):
+ (AutoinstallImportHook._install_eliza):
+ (AutoinstallImportHook._install):
+ * Scripts/webkitpy/thirdparty/__init___unittest.py:
+ (ThirdpartyTest.test_import_hook.MockImportHook.__init__):
+ (ThirdpartyTest.test_import_hook):
+
2012-11-03 Sheriff Bot <[email protected]>
Unreviewed, rolling out r133403, r133404, and r133409.
Modified: trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py (133413 => 133414)
--- trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py 2012-11-04 07:43:52 UTC (rev 133413)
+++ trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py 2012-11-04 08:03:03 UTC (rev 133414)
@@ -154,7 +154,7 @@
temp directory if it does not already exist.
"""
- prefix = target_name.replace(os.sep, "_") + "_"
+ prefix = target_name + "_"
try:
scratch_dir = self._create_scratch_directory_inner(prefix)
except OSError:
@@ -338,16 +338,11 @@
else:
os.remove(target_path)
- # shutil.move() command creates intermediate directories if they do not exist.
+ # The shutil.move() command creates intermediate directories if they
+ # do not exist, but we do not rely on this behavior since we
+ # need to create the __init__.py file anyway.
shutil.move(source_path, target_path)
- # ensure all the new directories are importable.
- intermediate_dirs = os.path.dirname(os.path.relpath(target_path, self._target_dir))
- parent_dirname = self._target_dir
- for dirname in intermediate_dirs.split(os.sep):
- parent_dirname = os.path.join(parent_dirname, dirname)
- self._make_package(parent_dirname)
-
self._record_url_downloaded(package_name, url)
def install(self, url, should_refresh=False, target_name=None,
@@ -383,8 +378,7 @@
if not should_refresh and self._is_downloaded(target_name, url):
return False
- package_name = target_name.replace(os.sep, '.')
- _log.info("Auto-installing package: %s" % package_name)
+ _log.info("Auto-installing package: %s" % target_name)
# The scratch directory is where we will download and prepare
# files specific to this install until they are ready to move
@@ -392,7 +386,7 @@
scratch_dir = self._create_scratch_directory(target_name)
try:
- self._install(package_name=package_name,
+ self._install(package_name=target_name,
target_path=target_path,
scratch_dir=scratch_dir,
url=""
Modified: trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py (133413 => 133414)
--- trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py 2012-11-04 07:43:52 UTC (rev 133413)
+++ trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py 2012-11-04 08:03:03 UTC (rev 133414)
@@ -65,11 +65,6 @@
def __init__(self, filesystem=None):
self._fs = filesystem or FileSystem()
- def _ensure_autoinstalled_dir_is_in_sys_path(self):
- # Some packages require that the are being put somewhere under a directory in sys.path.
- if not _AUTOINSTALLED_DIR in sys.path:
- sys.path.append(_AUTOINSTALLED_DIR)
-
def find_module(self, fullname, path):
# This method will run before each import. See http://www.python.org/dev/peps/pep-0302/
if '.autoinstalled' not in fullname:
@@ -103,13 +98,10 @@
"pep8-0.5.0/pep8.py")
def _install_pylint(self):
- self._ensure_autoinstalled_dir_is_in_sys_path()
did_install_something = False
if not self._fs.exists(self._fs.join(_AUTOINSTALLED_DIR, "pylint")):
- installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR)
- did_install_something = installer.install("http://pypi.python.org/packages/source/l/logilab-common/logilab-common-0.58.1.tar.gz#md5=77298ab2d8bb8b4af9219791e7cee8ce", url_subpath="logilab-common-0.58.1", target_name="logilab/common")
- did_install_something |= installer.install("http://pypi.python.org/packages/source/l/logilab-astng/logilab-astng-0.24.1.tar.gz#md5=ddaf66e4d85714d9c47a46d4bed406de", url_subpath="logilab-astng-0.24.1", target_name="logilab/astng")
- did_install_something |= installer.install('http://pypi.python.org/packages/source/p/pylint/pylint-0.25.1.tar.gz#md5=728bbc2b339bc3749af013709a7f87a5', url_subpath="pylint-0.25.1", target_name="pylint")
+ did_install_something = self._install('http://pypi.python.org/packages/source/p/pylint/pylint-0.25.1.tar.gz#md5=728bbc2b339bc3749af013709a7f87a5', 'pylint-0.25.1')
+ self._fs.move(self._fs.join(_AUTOINSTALLED_DIR, "pylint-0.25.1"), self._fs.join(_AUTOINSTALLED_DIR, "pylint"))
return did_install_something
# autoinstalled.buildbot is used by BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py
@@ -134,11 +126,18 @@
return did_install_something
def _install_coverage(self):
- self._ensure_autoinstalled_dir_is_in_sys_path()
- return self._install(url="" url_subpath="coverage-3.5.1/coverage")
+ installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR)
+ did_install_something = installer.install(url="" url_subpath="coverage-3.5.1/coverage")
+ # Note that coverage needs to be under a directory already in sys.path for its
+ # internal imports to work correctly :(.
+ if not _AUTOINSTALLED_DIR in sys.path:
+ sys.path.append(_AUTOINSTALLED_DIR)
+ return did_install_something
+
def _install_eliza(self):
- return self._install(url="" target_name="eliza.py")
+ installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR)
+ return installer.install(url="" target_name="eliza.py")
def _install_irc(self):
# Since irclib and ircbot are two top-level packages, we need to import
@@ -163,9 +162,9 @@
self._fs.write_text_file(init_path, "")
return did_install_something
- def _install(self, url, url_subpath=None, target_name=None):
+ def _install(self, url, url_subpath):
installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR)
- return installer.install(url="" url_subpath=url_subpath, target_name=target_name)
+ return installer.install(url="" url_subpath=url_subpath)
_hook = AutoinstallImportHook()
Modified: trunk/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py (133413 => 133414)
--- trunk/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py 2012-11-04 07:43:52 UTC (rev 133413)
+++ trunk/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py 2012-11-04 08:03:03 UTC (rev 133414)
@@ -32,14 +32,13 @@
from webkitpy.thirdparty import AutoinstallImportHook
-
class ThirdpartyTest(unittest.TestCase):
def test_import_hook(self):
# Add another import hook and make sure we get called.
class MockImportHook(AutoinstallImportHook):
def __init__(self):
AutoinstallImportHook.__init__(self)
- self.eliza_installed = False
+ self._eliza_installed = False
def _install_eliza(self):
self.eliza_installed = True
@@ -49,24 +48,11 @@
# The actual AutoinstallImportHook should be installed before us,
# so these modules will get installed before MockImportHook runs.
sys.meta_path.append(mock_import_hook)
- from webkitpy.thirdparty.autoinstalled import eliza # unused variable - pylint: disable-msg=W0612
+ from webkitpy.thirdparty.autoinstalled import eliza
self.assertTrue(mock_import_hook.eliza_installed)
finally:
sys.meta_path.remove(mock_import_hook)
- def test_imports(self):
- # This method tests that we can actually import everything.
- import webkitpy.thirdparty.autoinstalled.buildbot # unused variable - pylint: disable-msg=W0612
- import webkitpy.thirdparty.autoinstalled.coverage
- import webkitpy.thirdparty.autoinstalled.eliza
- import webkitpy.thirdparty.autoinstalled.irc.ircbot
- import webkitpy.thirdparty.autoinstalled.irc.irclib
- import webkitpy.thirdparty.autoinstalled.mechanize
- import webkitpy.thirdparty.autoinstalled.pylint
- import webkitpy.thirdparty.autoinstalled.webpagereplay
- import webkitpy.thirdparty.autoinstalled.pep8
-
-
if __name__ == '__main__':
unittest.main()