Пример #1
0
def _install_dependencies(interactive):
    """
    Install S2E's dependencies.

    Only apt-get is supported for now.
    """
    logger.info('Installing S2E dependencies')

    ubuntu_ver = _get_ubuntu_version()
    if not ubuntu_ver:
        return

    install_packages = CONSTANTS['dependencies']['common'] + \
                       CONSTANTS['dependencies']['ida']

    try:
        # Enable 32-bit libraries
        dpkg_add_arch = sudo.bake('dpkg', add_architecture=True, _fg=True)
        dpkg_add_arch('i386')

        # Perform apt-get install
        install_opts = ['--no-install-recommends'] + install_packages
        env = {}
        if not interactive:
            logger.info('Running install in non-interactive mode')
            env['DEBIAN_FRONTEND'] = 'noninteractive'
            install_opts = ['-y'] + install_opts

        apt_get = sudo.bake('apt-get', _fg=True, _env=env)
        apt_get.update()
        apt_get.install(install_opts)
    except ErrorReturnCode as e:
        raise CommandError(e)
Пример #2
0
def _install_dependencies():
    """
    Install S2E's dependencies.

    Only apt-get is supported for now.
    """
    logger.info('Installing S2E dependencies')

    ubuntu_ver = _get_ubuntu_version()
    if not ubuntu_ver:
        return

    install_packages = CONSTANTS['dependencies']['common'] +                    \
                       CONSTANTS['dependencies']['ubuntu_%d' % ubuntu_ver] +    \
                       CONSTANTS['dependencies']['ida']

    try:
        # Enable 32-bit libraries
        dpkg_add_arch = sudo.bake('dpkg', add_architecture=True, _fg=True)
        dpkg_add_arch('i386')

        # Perform apt-get install
        apt_get = sudo.bake('apt-get', _fg=True)
        apt_get.update()
        apt_get.install(install_packages)
    except ErrorReturnCode as e:
        raise CommandError(e)
Пример #3
0
def _install_dependencies(interactive):
    """
    Install S2E's dependencies.

    Only apt-get is supported for now.
    """
    logger.info('Installing S2E dependencies')

    ubuntu_ver = _get_ubuntu_version()
    if not ubuntu_ver:
        return

    all_install_packages = CONSTANTS['dependencies']['common'] + \
        CONSTANTS['dependencies'].get(f'ubuntu-{ubuntu_ver}', [])

    install_packages = []
    deb_package_urls = []
    for package in all_install_packages:
        if '.deb' in package:
            deb_package_urls.append(package)
        else:
            install_packages.append(package)

    install_opts = ['--no-install-recommends']
    env = {}
    if not interactive:
        logger.info('Running install in non-interactive mode')
        env['DEBIAN_FRONTEND'] = 'noninteractive'
        install_opts = ['-y'] + install_opts

    try:
        # Enable 32-bit libraries
        dpkg_add_arch = sudo.bake('dpkg', add_architecture=True, _fg=True)
        dpkg_add_arch('i386')

        # Perform apt-get install
        apt_get = sudo.bake('apt-get', _fg=True, _env=env)
        apt_get.update()
        apt_get.install(install_opts + install_packages)
    except ErrorReturnCode as e:
        raise CommandError(e)

    # Install deb files at the end
    for url in deb_package_urls:
        logger.info('Installing deb %s...', url)
        filename, _ = urllib.request.urlretrieve(url)
        os.rename(filename, f'{filename}.deb')
        apt_get = sudo.bake('apt-get', _fg=True, _env=env)
        apt_get.install(install_opts + [f'{filename}.deb'])
Пример #4
0
def _install_dependencies():
    """
    Install S2E's dependencies.

    Only apt-get is supported for now.
    """
    logger.info('Installing S2E dependencies')

    ubuntu_ver = _get_ubuntu_version()
    if not ubuntu_ver:
        return

    install_packages = CONSTANTS['dependencies']['common'] +                    \
                       CONSTANTS['dependencies']['ubuntu_%d' % ubuntu_ver] +    \
                       CONSTANTS['dependencies']['ida']

    try:
        apt_get = sudo.bake('apt-get', _fg=True)

        # Perform apt-get install
        apt_get.install(install_packages)
    except ErrorReturnCode as e:
        raise CommandError(e)