<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181088] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181088">181088</a></dd>
<dt>Author</dt> <dd>ossy@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-05 11:32:51 -0800 (Thu, 05 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[buildbot] mastercfg_unittest.py should be runnable easily
https://bugs.webkit.org/show_bug.cgi?id=142219

Reviewed by Chris Dumez.

Buildbot 0.8.6p1 runs on build.webkit org with Twisted 12.1.0, which is
the last Twisted version works together with this buildbot version.

* Scripts/webkitpy/common/system/autoinstall.py:
(AutoInstaller): Added prepend_to_search_path argument to be able
to prefer autoinstalled package to system package.
(AutoInstaller.__init__):
(AutoInstaller._set_up_target_dir):
(AutoInstaller._extract_tar): Renamed from _extract_targz, now it works with tar.bz2 too.
(AutoInstaller._prepare_package):
(AutoInstaller._extract_targz): Renamed to _extract_tar.
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook._install_buildbot): Autoinstall Twisted 12.1.0.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpycommonsystemautoinstallpy">trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py</a></li>
<li><a href="#trunkToolsScriptswebkitpythirdparty__init__py">trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (181087 => 181088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-03-05 19:32:27 UTC (rev 181087)
+++ trunk/Tools/ChangeLog        2015-03-05 19:32:51 UTC (rev 181088)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-03-05  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
+
+        [buildbot] mastercfg_unittest.py should be runnable easily
+        https://bugs.webkit.org/show_bug.cgi?id=142219
+
+        Reviewed by Chris Dumez.
+
+        Buildbot 0.8.6p1 runs on build.webkit org with Twisted 12.1.0, which is
+        the last Twisted version works together with this buildbot version.
+
+        * Scripts/webkitpy/common/system/autoinstall.py:
+        (AutoInstaller): Added prepend_to_search_path argument to be able
+        to prefer autoinstalled package to system package.
+        (AutoInstaller.__init__):
+        (AutoInstaller._set_up_target_dir):
+        (AutoInstaller._extract_tar): Renamed from _extract_targz, now it works with tar.bz2 too.
+        (AutoInstaller._prepare_package):
+        (AutoInstaller._extract_targz): Renamed to _extract_tar.
+        * Scripts/webkitpy/thirdparty/__init__.py:
+        (AutoinstallImportHook._install_buildbot): Autoinstall Twisted 12.1.0.
+
</ins><span class="cx"> 2015-03-05  Lukasz Bialek  &lt;l.bialek@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][WK2] Crash when &quot;Download Linked File&quot; from MiniBrowser context menu is clicked
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpycommonsystemautoinstallpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py (181087 => 181088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py        2015-03-05 19:32:27 UTC (rev 181087)
+++ trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py        2015-03-05 19:32:51 UTC (rev 181088)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">     &quot;&quot;&quot;Supports automatically installing Python packages from an URL.
</span><span class="cx"> 
</span><del>-    Supports uncompressed files, .tar.gz, and .zip formats.
</del><ins>+    Supports uncompressed files, .tar.gz, .tar.bz2 and .zip formats.
</ins><span class="cx"> 
</span><span class="cx">     Basic usage:
</span><span class="cx"> 
</span><span class="lines">@@ -70,13 +70,15 @@
</span><span class="cx"> 
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-    def __init__(self, append_to_search_path=False, make_package=True,
</del><ins>+    def __init__(self, append_to_search_path=False, prepend_to_search_path=False, make_package=True,
</ins><span class="cx">                  target_dir=None, temp_dir=None):
</span><span class="cx">         &quot;&quot;&quot;Create an AutoInstaller instance, and set up the target directory.
</span><span class="cx"> 
</span><span class="cx">         Args:
</span><span class="cx">           append_to_search_path: A boolean value of whether to append the
</span><span class="cx">                                  target directory to the sys.path search path.
</span><ins>+          prepend_to_search_path: A boolean value of whether to prepend the
+                                 target directory to the sys.path search path.
</ins><span class="cx">           make_package: A boolean value of whether to make the target
</span><span class="cx">                         directory a package.  This adds an __init__.py file
</span><span class="cx">                         to the target directory -- allowing packages and
</span><span class="lines">@@ -98,7 +100,7 @@
</span><span class="cx">             target_dir = os.path.join(this_dir, &quot;autoinstalled&quot;)
</span><span class="cx"> 
</span><span class="cx">         # Ensure that the target directory exists.
</span><del>-        self._set_up_target_dir(target_dir, append_to_search_path, make_package)
</del><ins>+        self._set_up_target_dir(target_dir, append_to_search_path, prepend_to_search_path, make_package)
</ins><span class="cx"> 
</span><span class="cx">         self._target_dir = target_dir
</span><span class="cx">         self._temp_dir = temp_dir
</span><span class="lines">@@ -107,14 +109,15 @@
</span><span class="cx">         with codecs.open(path, &quot;w&quot;, encoding) as filehandle:
</span><span class="cx">             filehandle.write(text)
</span><span class="cx"> 
</span><del>-    def _set_up_target_dir(self, target_dir, append_to_search_path,
-                           make_package):
</del><ins>+    def _set_up_target_dir(self, target_dir, append_to_search_path, prepend_to_search_path, make_package):
</ins><span class="cx">         &quot;&quot;&quot;Set up a target directory.
</span><span class="cx"> 
</span><span class="cx">         Args:
</span><span class="cx">           target_dir: The path to the target directory to set up.
</span><span class="cx">           append_to_search_path: A boolean value of whether to append the
</span><span class="cx">                                  target directory to the sys.path search path.
</span><ins>+          prepend_to_search_path: A boolean value of whether to prepend the
+                                 target directory to the sys.path search path.
</ins><span class="cx">           make_package: A boolean value of whether to make the target
</span><span class="cx">                         directory a package.  This adds an __init__.py file
</span><span class="cx">                         to the target directory -- allowing packages and
</span><span class="lines">@@ -128,6 +131,9 @@
</span><span class="cx">         if append_to_search_path:
</span><span class="cx">             sys.path.append(target_dir)
</span><span class="cx"> 
</span><ins>+        if prepend_to_search_path:
+            sys.path.insert(0, target_dir)
+
</ins><span class="cx">         if make_package:
</span><span class="cx">             self._make_package(target_dir)
</span><span class="cx"> 
</span><span class="lines">@@ -196,9 +202,17 @@
</span><span class="cx">         version_path = self._url_downloaded_path(target_name)
</span><span class="cx">         self._write_file(version_path, url, &quot;utf-8&quot;)
</span><span class="cx"> 
</span><del>-    def _extract_targz(self, path, scratch_dir):
-        # tarfile.extractall() extracts to a path without the trailing &quot;.tar.gz&quot;.
-        target_basename = os.path.basename(path[:-len(&quot;.tar.gz&quot;)])
</del><ins>+    def _extract_tar(self, path, scratch_dir):
+        # tarfile.extractall() extracts to a path without the trailing &quot;.tar.gz&quot; or &quot;.tar.bz2&quot;.
+
+        if path.endswith(&quot;.tar.gz&quot;):
+            tarFileSuffix = &quot;.tar.gz&quot;
+        elif path.endswith(&quot;.tar.bz2&quot;):
+            tarFileSuffix = &quot;.tar.bz2&quot;
+        else:
+            raise Exception(&quot;...&quot;)
+
+        target_basename = os.path.basename(path[:-len(tarFileSuffix)])
</ins><span class="cx">         target_path = os.path.join(scratch_dir, target_basename)
</span><span class="cx"> 
</span><span class="cx">         try:
</span><span class="lines">@@ -290,8 +304,8 @@
</span><span class="cx">         # FIXME: Add other natural extensions.
</span><span class="cx">         if path.endswith(&quot;.zip&quot;):
</span><span class="cx">             new_path = self._unzip(path, scratch_dir)
</span><del>-        elif path.endswith(&quot;.tar.gz&quot;):
-            new_path = self._extract_targz(path, scratch_dir)
</del><ins>+        elif path.endswith(&quot;.tar.gz&quot;) or path.endswith(&quot;.tar.bz2&quot;):
+            new_path = self._extract_tar(path, scratch_dir)
</ins><span class="cx">         elif _CACHE_ENV_VAR in os.environ:
</span><span class="cx">             new_path = path
</span><span class="cx">             if os.path.dirname(path) == os.path.normpath(os.environ[_CACHE_ENV_VAR]):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpythirdparty__init__py"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py (181087 => 181088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py        2015-03-05 19:32:27 UTC (rev 181087)
+++ trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py        2015-03-05 19:32:51 UTC (rev 181088)
</span><span class="lines">@@ -137,6 +137,10 @@
</span><span class="cx">         installer.install(url=&quot;http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.7.7.tar.gz#md5=ddf6df7e014cea318fa981364f3f93b9&quot;,
</span><span class="cx">                                                  url_subpath=&quot;SQLAlchemy-0.7.7/lib/sqlalchemy&quot;)
</span><span class="cx"> 
</span><ins>+        twisted_dir = self._fs.join(_AUTOINSTALLED_DIR, &quot;twisted&quot;)
+        installer = AutoInstaller(prepend_to_search_path=True, target_dir=twisted_dir)
+        installer.install(url=&quot;https://pypi.python.org/packages/source/T/Twisted/Twisted-12.1.0.tar.bz2#md5=f396f1d6f5321e869c2f89b2196a9eb5&quot;, url_subpath=&quot;Twisted-12.1.0/twisted&quot;)
+
</ins><span class="cx">         self._install(&quot;http://pypi.python.org/packages/source/b/buildbot/buildbot-0.8.6p1.tar.gz#md5=b6727d2810c692062c657492bcbeac6a&quot;, &quot;buildbot-0.8.6p1/buildbot&quot;)
</span><span class="cx"> 
</span><span class="cx">     def _install_coverage(self):
</span></span></pre>
</div>
</div>

</body>
</html>