Install local or remote NApps.

        This method is recursive, it will install each napps and your
        dependencies.
192060
def install_napps(cls, napps):
        
        mgr = NAppsManager()
        for napp in napps:
            mgr.set_napp(*napp)
            LOG.info('  NApp %s:', mgr.napp_id)

            if not mgr.is_installed():
                try:
                    cls.install_napp(mgr)
                    if not mgr.is_enabled():
                        cls.enable_napp(mgr)
                        napp_dependencies = mgr.dependencies()
                        if napp_dependencies:
                            LOG.info('Installing Dependencies:')
                            cls.install_napps(napp_dependencies)
                    else:
                        LOG.warning('  Napp already enabled.')
                except KytosException:
                    continue
            else:
                LOG.warning('  Napp already enabled.')
1260173
def put(self, local, remote, sudo=False):
        
        if(os.path.isdir(local)):
            self.put_dir(local, remote, sudo=sudo)
        else:
            self.put_single(local, remote, sudo=sudo)
926885
protected function install()
    {
        // Version-specific.
        $this->maybeRunVsUpgrades();

        // Misc installers.
        $this->createDbTables();
        $this->otherInstallRoutines();
        $this->doFlushRewriteRules();
        $this->maybeEnqueueNotices();

        // History/options.
        $this->updateHistory();
        $this->updateOptions();
    }
460880
protected function installAllModules()
    {
        $this->displayMsgNLInCli('Read all modules to run install script...');
        
        $tree = \BFW\Install\Application::getInstance()
            ->getModuleList()
            ->getLoadTree()
        ;

        foreach ($tree as $firstLine) {
            foreach ($firstLine as $secondLine) {
                foreach ($secondLine as $moduleName) {
                    if (!isset($this->listToInstall[$moduleName])) {
                        continue;
                    }
                    
                    $this->installModule($moduleName);
                }
            }
        }
        
        $this->displayMsgNLInCli('All modules have been read.');
    }
1257370
public function install()
    {
        $this->ensureComponentDirectoryExists();
        $this->updatePackages();
        $this->updateWebpackConfiguration();
        $this->updateBootstrapping();
        $this->updateComponent();
        $this->removeNodeModules();
    }
167182
function installNodeModules(modules, callback) {
    // base case
    if (modules.length <= 0) {
      return callback();
    }

    // install one at a time
    const module = modules.pop();
    console.log(`BRANCH SDK: Installing node dependency ${module}`);

    const install = `npm install --prefix ./plugins/${SDK} -D ${module}`;
    exec(install, (err, stdout, stderr) => {
      // handle error
      if (err) {
        throw new Error(
          `BRANCH SDK: Failed to install Branch node dependency ${module}. Docs https://goo.gl/GijGKP`
        );
      } else {
        // next module
        installNodeModules(modules, callback);
      }
    });
  }
1030128
protected function install()
    {
        $installScripts = array();
        foreach ($this->autoloaderCollection as $dir => $jsonAutoloader) {
            $bundleName = $jsonAutoloader->getBundleName();
            $this->installPackage($dir, $jsonAutoloader);

            // Check if the bundle under exam has attached an ActionManager file
            $actionsManager = $jsonAutoloader->getActionManager();
            if ((!array_key_exists($bundleName, $this->installedBundles) && null !== $actionsManager)) {
                if (null !== $jsonAutoloader->getActionManagerClass()) {
                    $installScripts[$bundleName] = $actionsManager;

                    // Copies the current ActionManager class to app/config/bundles/cache folder
                    // because it must be preserved when a bundle is uninstalled
                    $reflection = new \ReflectionClass($actionsManager);
                    $fileName = $reflection->getFileName();
                    $className = $this->cachePath . '/' . $bundleName . '/' . basename($fileName);
                    $this->filesystem->copy($fileName, $className, true);
                }
            }

            unset($this->installedBundles[$bundleName]);
        }

        $installerScript = $this->scriptFactory->createScript('PreBootInstaller');
        $installerScript->executeActions($installScripts);
    }
135541
def init():
    '''
    
    '''
    bp_ = os.path.join(__opts__['cachedir'], 'svnfs')
    new_remote = False
    repos = []

    per_remote_defaults = {}
    for param in PER_REMOTE_OVERRIDES:
        per_remote_defaults[param] = \
            six.text_type(__opts__['svnfs_{0}'.format(param)])

    for remote in __opts__['svnfs_remotes']:
        repo_conf = copy.deepcopy(per_remote_defaults)
        if isinstance(remote, dict):
            repo_url = next(iter(remote))
            per_remote_conf = dict(
                [(key, six.text_type(val)) for key, val in
                 six.iteritems(salt.utils.data.repack_dictlist(remote[repo_url]))]
            )
            if not per_remote_conf:
                log.error(
                    'Invalid per-remote configuration for remote %s. If no '
                    'per-remote parameters are being specified, there may be '
                    'a trailing colon after the URL, which should be removed. '
                    'Check the master configuration file.', repo_url
                )
                _failhard()

            per_remote_errors = False
            for param in (x for x in per_remote_conf
                          if x not in PER_REMOTE_OVERRIDES):
                log.error(
                    'Invalid configuration parameter \'%s\' for remote %s. '
                    'Valid parameters are: %s. See the documentation for '
                    'further information.',
                    param, repo_url, ', '.join(PER_REMOTE_OVERRIDES)
                )
                per_remote_errors = True
            if per_remote_errors:
                _failhard()

            repo_conf.update(per_remote_conf)
        else:
            repo_url = remote

        if not isinstance(repo_url, six.string_types):
            log.error(
                'Invalid svnfs remote %s. Remotes must be strings, you may '
                'need to enclose the URL in quotes', repo_url
            )
            _failhard()

        try:
            repo_conf['mountpoint'] = salt.utils.url.strip_proto(
                repo_conf['mountpoint']
            )
        except TypeError:
            # mountpoint not specified
            pass

        hash_type = getattr(hashlib, __opts__.get('hash_type', 'md5'))
        repo_hash = hash_type(repo_url).hexdigest()
        rp_ = os.path.join(bp_, repo_hash)
        if not os.path.isdir(rp_):
            os.makedirs(rp_)

        if not os.listdir(rp_):
            # Only attempt a new checkout if the directory is empty.
            try:
                CLIENT.checkout(repo_url, rp_)
                repos.append(rp_)
                new_remote = True
            except pysvn._pysvn.ClientError as exc:
                log.error(
                    'Failed to initialize svnfs remote \'%s\': %s',
                    repo_url, exc
                )
                _failhard()
        else:
            # Confirm that there is an svn checkout at the necessary path by
            # running pysvn.Client().status()
            try:
                CLIENT.status(rp_)
            except pysvn._pysvn.ClientError as exc:
                log.error(
                    'Cache path %s (corresponding remote: %s) exists but is '
                    'not a valid subversion checkout. You will need to '
                    'manually delete this directory on the master to continue '
                    'to use this svnfs remote.', rp_, repo_url
                )
                _failhard()

        repo_conf.update({
            'repo': rp_,
            'url': repo_url,
            'hash': repo_hash,
            'cachedir': rp_,
            'lockfile': os.path.join(rp_, 'update.lk')
        })
        repos.append(repo_conf)

    if new_remote:
        remote_map = os.path.join(__opts__['cachedir'], 'svnfs/remote_map.txt')
        try:
            with salt.utils.files.fopen(remote_map, 'w+') as fp_:
                timestamp = datetime.now().strftime('%d %b %Y %H:%M:%S.%f')
                fp_.write('# svnfs_remote map as of {0}\n'.format(timestamp))
                for repo_conf in repos:
                    fp_.write(
                        salt.utils.stringutils.to_str(
                            '{0} = {1}\n'.format(
                                repo_conf['hash'], repo_conf['url']
                            )
                        )
                    )
        except OSError:
            pass
        else:
            log.info('Wrote new svnfs_remote map to %s', remote_map)

    return repos
1000529
def install_remote(self):
        """"""
        package, pkg_folder = None, None
        try:
            package = self._download()
            pkg_folder = self._extract(package)
            napp_folder = self._get_local_folder(pkg_folder)
            dst = self._installed / self.user / self.napp
            self._check_module(dst.parent)
            shutil.move(str(napp_folder), str(dst))
        finally:
            # Delete temporary files
            if package:
                Path(package).unlink()
            if pkg_folder and pkg_folder.exists():
                shutil.rmtree(str(pkg_folder))
1155587
public void install() {

        OpenCms.getEventManager().addCmsEventListener(
            this,
            new int[] {
                I_CmsEventListener.EVENT_CLEAR_CACHES,
                I_CmsEventListener.EVENT_CLEAR_OFFLINE_CACHES,
                I_CmsEventListener.EVENT_CLEAR_ONLINE_CACHES});
    }
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);
            }
        }
    }
187474
public function setupStubPath()
    {
        $this->app->booted(function ($app) {
            Stub::setBasePath(__DIR__.'/Commands/stubs');

            if ($app['modules']->config('stubs.enabled') === true) {
                Stub::setBasePath($app['modules']->config('stubs.path'));
            }
        });
    }
979275
public void addDependencies( Project project, List<String> scopes ) throws ProjectException {
        for ( org.apache.maven.model.Dependency dependency : project.getDependencies(scopes) ) {
            addDependency( dependency );
        }
        
        // Add remote repositories from pom
        for ( Repository repo : project.getMavenModel().getRepositories() ) {
            this.addRemoteRepository( repo.getId(), repo.getLayout(), repo.getUrl() );
        }
    }
608311
public function install()
    {
        $this->update();

        foreach ((array) $this->plugin as $plugin) {
            safe_update('txp_plugin', 'status = 1', "name = '".doSlash($plugin->name)."'");
        }
    }
1175877
public void addRemoteRepository(RemoteRepository remoteRepository) {
        if (this.repositoryIds.add(remoteRepository.getId()) ) {
            getRemoteRepositories().add(remoteRepository);
        }
    }
775256
def install_dependencies(dependencies, verbose=False):
    """"""
    if not dependencies:
        return

    stdout = stderr = None if verbose else subprocess.DEVNULL
    with tempfile.TemporaryDirectory() as req_dir:
        req_file = Path(req_dir) / "requirements.txt"

        with open(req_file, "w") as f:
            for dependency in dependencies:
                f.write(f"{dependency}\n")

        pip = ["python3", "-m", "pip", "install", "-r", req_file]
        # Unless we are in a virtualenv, we need --user
        if sys.base_prefix == sys.prefix and not hasattr(sys, "real_prefix"):
            pip.append("--user")

        try:
            subprocess.check_call(pip, stdout=stdout, stderr=stderr)
        except subprocess.CalledProcessError:
            raise Error(_("failed to install dependencies"))

        # Reload sys.path, to find recently installed packages
        importlib.reload(site)
147866
def install(self):
        
        super(SystemD, self).install()

        self.deploy_service_file(self.svc_file_path, self.svc_file_dest)
        self.deploy_service_file(self.env_file_path, self.env_file_dest)
        sh.systemctl.enable(self.name)
        sh.systemctl('daemon-reload')