Changeset 181088 in webkit


Ignore:
Timestamp:
Mar 5, 2015 11:32:51 AM (9 years ago)
Author:
Csaba Osztrogonác
Message:

[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.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r181076 r181088  
     12015-03-05  Csaba Osztrogonác  <ossy@webkit.org>
     2
     3        [buildbot] mastercfg_unittest.py should be runnable easily
     4        https://bugs.webkit.org/show_bug.cgi?id=142219
     5
     6        Reviewed by Chris Dumez.
     7
     8        Buildbot 0.8.6p1 runs on build.webkit org with Twisted 12.1.0, which is
     9        the last Twisted version works together with this buildbot version.
     10
     11        * Scripts/webkitpy/common/system/autoinstall.py:
     12        (AutoInstaller): Added prepend_to_search_path argument to be able
     13        to prefer autoinstalled package to system package.
     14        (AutoInstaller.__init__):
     15        (AutoInstaller._set_up_target_dir):
     16        (AutoInstaller._extract_tar): Renamed from _extract_targz, now it works with tar.bz2 too.
     17        (AutoInstaller._prepare_package):
     18        (AutoInstaller._extract_targz): Renamed to _extract_tar.
     19        * Scripts/webkitpy/thirdparty/__init__.py:
     20        (AutoinstallImportHook._install_buildbot): Autoinstall Twisted 12.1.0.
     21
    1222015-03-05  Lukasz Bialek  <l.bialek@samsung.com>
    223
  • trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py

    r174448 r181088  
    5858    """Supports automatically installing Python packages from an URL.
    5959
    60     Supports uncompressed files, .tar.gz, and .zip formats.
     60    Supports uncompressed files, .tar.gz, .tar.bz2 and .zip formats.
    6161
    6262    Basic usage:
     
    7171    """
    7272
    73     def __init__(self, append_to_search_path=False, make_package=True,
     73    def __init__(self, append_to_search_path=False, prepend_to_search_path=False, make_package=True,
    7474                 target_dir=None, temp_dir=None):
    7575        """Create an AutoInstaller instance, and set up the target directory.
     
    7777        Args:
    7878          append_to_search_path: A boolean value of whether to append the
     79                                 target directory to the sys.path search path.
     80          prepend_to_search_path: A boolean value of whether to prepend the
    7981                                 target directory to the sys.path search path.
    8082          make_package: A boolean value of whether to make the target
     
    99101
    100102        # Ensure that the target directory exists.
    101         self._set_up_target_dir(target_dir, append_to_search_path, make_package)
     103        self._set_up_target_dir(target_dir, append_to_search_path, prepend_to_search_path, make_package)
    102104
    103105        self._target_dir = target_dir
     
    108110            filehandle.write(text)
    109111
    110     def _set_up_target_dir(self, target_dir, append_to_search_path,
    111                            make_package):
     112    def _set_up_target_dir(self, target_dir, append_to_search_path, prepend_to_search_path, make_package):
    112113        """Set up a target directory.
    113114
     
    115116          target_dir: The path to the target directory to set up.
    116117          append_to_search_path: A boolean value of whether to append the
     118                                 target directory to the sys.path search path.
     119          prepend_to_search_path: A boolean value of whether to prepend the
    117120                                 target directory to the sys.path search path.
    118121          make_package: A boolean value of whether to make the target
     
    128131        if append_to_search_path:
    129132            sys.path.append(target_dir)
     133
     134        if prepend_to_search_path:
     135            sys.path.insert(0, target_dir)
    130136
    131137        if make_package:
     
    197203        self._write_file(version_path, url, "utf-8")
    198204
    199     def _extract_targz(self, path, scratch_dir):
    200         # tarfile.extractall() extracts to a path without the trailing ".tar.gz".
    201         target_basename = os.path.basename(path[:-len(".tar.gz")])
     205    def _extract_tar(self, path, scratch_dir):
     206        # tarfile.extractall() extracts to a path without the trailing ".tar.gz" or ".tar.bz2".
     207
     208        if path.endswith(".tar.gz"):
     209            tarFileSuffix = ".tar.gz"
     210        elif path.endswith(".tar.bz2"):
     211            tarFileSuffix = ".tar.bz2"
     212        else:
     213            raise Exception("...")
     214
     215        target_basename = os.path.basename(path[:-len(tarFileSuffix)])
    202216        target_path = os.path.join(scratch_dir, target_basename)
    203217
     
    291305        if path.endswith(".zip"):
    292306            new_path = self._unzip(path, scratch_dir)
    293         elif path.endswith(".tar.gz"):
    294             new_path = self._extract_targz(path, scratch_dir)
     307        elif path.endswith(".tar.gz") or path.endswith(".tar.bz2"):
     308            new_path = self._extract_tar(path, scratch_dir)
    295309        elif _CACHE_ENV_VAR in os.environ:
    296310            new_path = path
  • trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py

    r178589 r181088  
    138138                                                 url_subpath="SQLAlchemy-0.7.7/lib/sqlalchemy")
    139139
     140        twisted_dir = self._fs.join(_AUTOINSTALLED_DIR, "twisted")
     141        installer = AutoInstaller(prepend_to_search_path=True, target_dir=twisted_dir)
     142        installer.install(url="https://pypi.python.org/packages/source/T/Twisted/Twisted-12.1.0.tar.bz2#md5=f396f1d6f5321e869c2f89b2196a9eb5", url_subpath="Twisted-12.1.0/twisted")
     143
    140144        self._install("http://pypi.python.org/packages/source/b/buildbot/buildbot-0.8.6p1.tar.gz#md5=b6727d2810c692062c657492bcbeac6a", "buildbot-0.8.6p1/buildbot")
    141145
Note: See TracChangeset for help on using the changeset viewer.