install perforce binary
194414
def __install_perforce(self, config):
        
        if not system.is_64_bit():
            self.logger.warn("Perforce formula is only designed for 64 bit systems! Not install executables...")
            return False
        version = config.get('version', 'r13.2')
        key = 'osx' if system.is_osx() else 'linux'
        perforce_packages = package_dict[version][key]
        d = self.directory.install_directory(self.feature_name)
        if not os.path.exists(d):
            os.makedirs(d)
        self.logger.info("Downloading p4 executable...")
        with open(os.path.join(d, "p4"), 'wb+') as fh:
            fh.write(lib.cleaned_request('get', url_prefix + perforce_packages['p4']).content)
        self.directory.symlink_to_bin("p4", os.path.join(d, "p4"))
        self.p4_command = os.path.join(d, "p4")
        self.logger.info("Installing p4v...")
        if system.is_osx():
            return self._install_p4v_osx(url_prefix + perforce_packages['p4v'])
        else:
            return self._install_p4v_linux(url_prefix + perforce_packages['p4v'])
904240
def install_PMK(self):
        """"""
        self.pmk = PBKDF2HMAC(
            algorithm=hashes.SHA1(),
            length=32,
            salt=self.ssid.encode(),
            iterations=4096,
            backend=default_backend(),
        ).derive(self.passphrase.encode())
1223264
function checkAndDownloadBinary() {
  try {
    process.sass.getBinaryPath(true);
    return;
  } catch (e) { }

  mkdir(path.dirname(process.sass.binaryPath), function(err) {
    if (err) {
      console.error(err);
      return;
    }

    download(process.sass.binaryUrl, process.sass.binaryPath, function(err) {
      if (err) {
        console.error(err);
        return;
      }

      console.log('Binary downloaded and installed at', process.sass.binaryPath);
    });
  });
}
856593
public function install()
    {
        $disk = Storage::createLocalDriver([
            'driver' => 'local',
            'root'   => app_path(),
        ]);
        
        $this->info('Publishing required files', 1);
        $this->call('vendor:publish', ['--provider' => TwoStreamServiceProvider::class, '--tag' => ['required']], 2);
        
        $this->info('Applying your app\'s namespace <comment>[' . $this->appNamespace . ']</comment>', 1);
        foreach (TwoStreamServiceProvider::pathsToPublish(TwoStreamServiceProvider::class, 'required') as $required) {
            $required = str_replace(app_path(), '', $required);
            $originalFile = $disk->get($required);
            $file = str_replace('{{namespace}}', $this->appNamespace, $originalFile);
            
            if ($file != $originalFile) {
                $this->info('Setting namespace for <comment>[/app' . str_replace([app_path(), '.php', '.stub'], '', $required) . ']</comment>', 2);
                $disk->put($required, $file);
            }
            
            if (! $disk->exists(str_replace('.stub', '.php', $required))) {
                $disk->move($required, str_replace('.stub', '.php', $required));
            }
        }
        
        $this->info('Cleaning up...', 1);
        $this->level(0);
        $files = array_merge($disk->allFiles('Ws'), $disk->allFiles('Exceptions'));
        foreach ($files as $key => $file) {
            if (preg_match('/\\.stub$/', $file)) {
                $disk->delete($file);
            }
        }
    }
724731
def install():
    '''
        
    '''
    tmp_weboob_dir = '/tmp/weboob'

    # Check that the directory does not already exists
    while (os.path.exists(tmp_weboob_dir)):
        tmp_weboob_dir += '1'

    # Clone the repository
    print 'Fetching sources in temporary dir {}'.format(tmp_weboob_dir)
    result = cmd_exec('git clone {} {}'.format(WEBOOB_REPO, tmp_weboob_dir))
    if (result['error']):
        print result['stderr']
        print 'Weboob installation failed: could not clone repository'
        exit()

    print 'Sources fetched, will now process to installation'

    # Launch the installation
    result = cmd_exec('cd {} && ./setup.py install'.format(tmp_weboob_dir))

    # Remove the weboob directory
    shutil.rmtree(tmp_weboob_dir)

    if (result['error']):
        print result['stderr']
        print 'Weboob installation failed: setup failed'
        exit()

    print result['stdout']

    # Check weboob version
    weboob_version = get_weboob_version()
    if (not weboob_version):
        print 'Weboob installation failed: version not detected'
        exit()

    print 'Weboob (version: {}) installation succeeded'.format(weboob_version)
    update()
443084
def install_symlink
      FileUtils.mkdir_p File.dirname(destination_path)
      FileUtils.symlink source_path, destination_path, force: true
    end
299885
def check_flashing_need(self, execution_type, build_id, force):
        
        binary_file_name = AllocationContextList.get_build(build_id)
        if binary_file_name:
            if execution_type == 'hardware' and os.path.isfile(binary_file_name):
                if not force:
                    #@todo: Make a better check for binary compatibility
                    extension_split = os.path.splitext(binary_file_name)
                    extension = extension_split[-1].lower()
                    if extension != '.bin' and extension != '.hex':
                        self.logger.debug("File ('%s') is not supported to flash, skip it" %(
                            build_id))
                        return False
                    return True
                return True
            else:
                raise ResourceInitError("Given binary %s does not exist" % build_id)
        else:
            raise ResourceInitError("Given binary %s does not exist" % build_id)
712810
def install(self):
        
        other_args = list(requirement_args(self._argv, want_other=True))
        archive_path = join(self._temp_path, self._downloaded_filename())
        # -U so it installs whether pip deems the requirement "satisfied" or
        # not. This is necessary for GitHub-sourced zips, which change without
        # their version numbers changing.
        run_pip(['install'] + other_args + ['--no-deps', '-U', archive_path])
396767
def run(self):
    """"""

    module = self.distribution.ext_modules[0]
    base_dir = os.path.dirname(__file__)

    if base_dir:
      os.chdir(base_dir)

    exclusions = []

    for define in self.define or []:
      module.define_macros.append(define)

    for library in self.libraries or []:
      module.libraries.append(library)

    building_for_windows = self.plat_name in ('win32','win-amd64')
    building_for_osx = 'macosx' in self.plat_name
    building_for_linux = 'linux' in self.plat_name
    building_for_freebsd = 'freebsd' in self.plat_name
    building_for_openbsd = 'openbsd' in self.plat_name # need testing

    if building_for_linux:
      module.define_macros.append(('USE_LINUX_PROC', '1'))
    elif building_for_windows:
      module.define_macros.append(('USE_WINDOWS_PROC', '1'))
      module.define_macros.append(('_CRT_SECURE_NO_WARNINGS', '1'))
      module.libraries.append('kernel32')
      module.libraries.append('advapi32')
      module.libraries.append('user32')
      module.libraries.append('crypt32')
      module.libraries.append('ws2_32')
    elif building_for_osx:
      module.define_macros.append(('USE_MACH_PROC', '1'))
      module.include_dirs.append('/usr/local/opt/openssl/include')
      module.include_dirs.append('/opt/local/include')
      module.library_dirs.append('/opt/local/lib')
      module.include_dirs.append('/usr/local/include')
      module.library_dirs.append('/usr/local/lib')
    elif building_for_freebsd:
      module.define_macros.append(('USE_FREEBSD_PROC', '1'))
      module.include_dirs.append('/opt/local/include')
      module.library_dirs.append('/opt/local/lib')
      module.include_dirs.append('/usr/local/include')
      module.library_dirs.append('/usr/local/lib')
    elif building_for_openbsd:
      module.define_macros.append(('USE_OPENBSD_PROC', '1'))
      module.include_dirs.append('/opt/local/include')
      module.library_dirs.append('/opt/local/lib')
      module.include_dirs.append('/usr/local/include')
      module.library_dirs.append('/usr/local/lib')
    else:
      module.define_macros.append(('USE_NO_PROC', '1'))

    if has_function('memmem'):
      module.define_macros.append(('HAVE_MEMMEM', '1'))
    if has_function('strlcpy'):
      module.define_macros.append(('HAVE_STRLCPY', '1'))
    if has_function('strlcat'):
      module.define_macros.append(('HAVE_STRLCAT', '1'))

    if self.enable_profiling:
      module.define_macros.append(('PROFILING_ENABLED', '1'))

    if self.dynamic_linking:
      module.libraries.append('yara')
    else:
      if not self.define or not ('HASH_MODULE', '1') in self.define:
        if (has_function('MD5_Init', libraries=['crypto']) and
            has_function('SHA256_Init', libraries=['crypto'])):
          module.define_macros.append(('HASH_MODULE', '1'))
          module.define_macros.append(('HAVE_LIBCRYPTO', '1'))
          module.libraries.append('crypto')
        else:
          exclusions.append('yara/libyara/modules/hash.c')

      if self.enable_magic:
        module.define_macros.append(('MAGIC_MODULE', '1'))
        module.libraries.append('magic')
      else:
        exclusions.append('yara/libyara/modules/magic.c')

      if self.enable_cuckoo:
        module.define_macros.append(('CUCKOO_MODULE', '1'))
        module.libraries.append('jansson')
      else:
        exclusions.append('yara/libyara/modules/cuckoo.c')

      if self.enable_dotnet:
        module.define_macros.append(('DOTNET_MODULE', '1'))
      else:
        exclusions.append('yara/libyara/modules/dotnet.c')

      if self.enable_dex:
        module.define_macros.append(('DEX_MODULE', '1'))
      else:
        exclusions.append('yara/libyara/modules/dex.c')

      if self.enable_macho:
        module.define_macros.append(('MACHO_MODULE', '1'))
      else:
        exclusions.append('yara/libyara/modules/macho.c')

      exclusions = [os.path.normpath(x) for x in exclusions]

      for directory, _, files in os.walk('yara/libyara/'):
        for x in files:
          x = os.path.normpath(os.path.join(directory, x))
          if x.endswith('.c') and x not in exclusions:
            module.sources.append(x)

    build_ext.run(self)
803437
def install(self):
        
        self._start_install()
        mr_link = self._get_mr_link()

        # Set up the progress bar
        pbar = ProgressBar(100, 'Running installation...')
        pbar.start()
        mr_j, mr_r = self._ajax(mr_link)

        # Loop until we get a redirect json response
        while True:
            mr_link = self._parse_response(mr_link, mr_j)

            stage = self._get_stage(mr_j)
            progress = self._get_progress(mr_j)
            mr_j, mr_r = self._ajax(mr_link)

            pbar.update(min([progress, 100]), stage)  # NOTE: Response may return progress values above 100

            # If we're done, finalize the installation and break
            redirect = self._check_if_complete(mr_link, mr_j)
            if redirect:
                pbar.finish()
                break

        p = Echo('Finalizing...')
        mr_r = self._request(redirect, raise_request=False)
        p.done()

        # Install developer tools
        if self.site.in_dev:
            DevToolsInstaller(self.ctx, self.site).install()

        # Get the link to our community homepage
        self._finalize(mr_r)
663604
def install(self):
        '''
        
        '''
        remote_path = os.path.join(self.venv, 'requirements.txt')
        put(self.requirements, remote_path)
        run('{pip} install -r {requirements}'.format(
            pip=self.pip(), requirements=remote_path))
39267
def _prep_bins():
    

    from os import path
    from sys import platform, maxsize
    from shutil import copy
    bit_suffix = "-x86_64" if maxsize > 2**32 else "-x86"
    package_root = path.abspath(path.dirname(__file__))
    prebuilt_path = path.join(package_root, "prebuilt", platform + bit_suffix)
    config = {"MANIFEST_DIR": prebuilt_path}
    try:
        execfile(path.join(prebuilt_path, "manifest.pycfg"), config)
    except IOError:
        return  # there are no prebuilts for this platform - nothing to do
    files = map(lambda x: path.join(prebuilt_path, x), config["FILES"])
    for prebuilt_file in files:
        try:
            copy(path.join(prebuilt_path, prebuilt_file), package_root)
        except IOError:
            pass
1118822
def install_requirements(self):
        """"""
        print('Installing Requirements')
        print(platform.dist())
        if platform.dist()[0] in ['Ubuntu', 'LinuxMint']:
            command = 'sudo apt-get install -y gcc git python3-dev zlib1g-dev make zip libssl-dev libbz2-dev liblzma-dev libcurl4-openssl-dev build-essential libxml2-dev apache2 zlib1g-dev bcftools build-essential cpanminus curl git libbz2-dev libcurl4-openssl-dev liblocal-lib-perl liblzma-dev libmysqlclient-dev libpng-dev libpq-dev libssl-dev manpages mysql-client openssl perl perl-base pkg-config python3-dev python3-pip python3-setuptools sed tabix unzip vcftools vim wget zlib1g-dev apache2 build-essential cpanminus curl git libmysqlclient-dev libpng-dev libssl-dev locales manpages mysql-client openssl perl perl-base unzip vim wget libgd-dev'  # lamp-server^
            sts = call(command, shell=True)

            try:
                subprocess.call(['java', '-version'])
            except:

                command = """sudo apt install -y software-properties-common
                       sudo add-apt-repository -y ppa:webupd8team/java
                       sudo apt-get update
                       echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
                       sudo apt-get -y install oracle-java8-installer"""

                sts = call(command, shell=True)
        elif platform.dist()[0] in ['debian']:
            command = 'sudo apt-get update'
            sts = call(command, shell=True)

            command = 'sudo apt-get install -y libmodule-install-perl apache2 bcftools build-essential cpanminus curl git libbz2-dev libcurl4-openssl-dev liblocal-lib-perl liblzma-dev default-libmysqlclient-dev libpng-dev libpq-dev libssl-dev manpages mysql-client openssl perl perl-base pkg-config python3-dev python3-pip python3-setuptools sed tabix unzip vcftools vim wget zlib1g-dev apache2 build-essential cpanminus curl git libpng-dev libssl-dev locales manpages mysql-client openssl perl perl-base unzip vim wget libgd-dev libxml-libxml-perl libgd-dev'  # lamp-server^
            sts = call(command, shell=True)
            command = 'sudo apt-get install -y default-jre default-jdk'
            sts = call(command, shell=True)
        
        elif platform.dist()[0] in ['redhat', 'centos']:

            command = 'sudo yum install libcurl-devel sed vcftools bcftools tabix zlib-devel postgresql96-libs perl-local-lib perl-App-cpanminus curl unzip wget'
            sts = call(command, shell=True)
            command = """sudo yum groupinstall 'Development Tools'"""
            sts = call(command, shell=True)
            command = """sudo yum install gcc gcc-c++ make openssl-devel"""
            sts = call(command, shell=True)

            try:
                subprocess.call(['java', '-version'])
            except:
                command = "sudo yum install -y java-1.8.0-openjdk"
                sts = call(command, shell=True)
        # Perl Requirements
        command = "sudo cpanm DBI DBD::mysql File::Copy::Recursive Archive::Extract Archive::Zip LWP::Simple Bio::Root::Version LWP::Protocol::https Bio::DB::Fasta CGI Test::utf8 Test::File inc::Module::Install XML::DOM::XPath XML::LibXML"
        sts = call(command, shell=True)
        command = "sudo cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)"
        sts = call(command, shell=True)
132086
def install_deb(pkgname, url):
    """"""
    status = run("dpkg-query -W -f='${{Status}}' {p}; true".format(p=pkgname))
    if ('installed' not in status) or ('not-installed' in status):
        deb = url.rpartition('/')[2]
        debtmp = '/tmp/{}'.format(deb)
        run("wget --no-check-certificate -qc -O '{}' '{}'".format(debtmp, url))
        sudo("dpkg -i '{0}' && rm -f '{0}'".format(debtmp))
        return True
    else:
        return False
584004
def install(config):  # pragma: no cover
        """"""
        client = Client()
        client.prepare_connection()
        key_api = API(client)
        key_api.install()
1014247
def install(self, update=False):
        
        offline = self.offline or update
        self.create_env(offline)
        self.install_pkgs(offline)
        self.install_pip(offline)
        return tuple()
959409
def getenforce():
    '''
    
    '''
    _selinux_fs_path = selinux_fs_path()
    if _selinux_fs_path is None:
        return 'Disabled'
    try:
        enforce = os.path.join(_selinux_fs_path, 'enforce')
        with salt.utils.files.fopen(enforce, 'r') as _fp:
            if salt.utils.stringutils.to_unicode(_fp.readline()).strip() == '0':
                return 'Permissive'
            else:
                return 'Enforcing'
    except (IOError, OSError, AttributeError):
        return 'Disabled'