Install but do not upgrade required plugin packages.
494415
def ensure_packages(packages):
    """"""
    required = filter_installed_packages(packages)
    if required:
        apt_install(required, fatal=True)
248860
def upgrade(self, only):
        """"""
        repositories = self.meta.repositories
        if only:
            repositories = only
        for repo in repositories:
            changelogs = "{0}{1}{2}".format(self.log_path, repo,
                                            "/ChangeLog.txt")
            if os.path.isfile(changelogs):
                os.remove(changelogs)
            if os.path.isdir(self.lib_path + "{0}_repo/".format(repo)):
                for f in (os.listdir(self.lib_path + "{0}_repo/".format(
                        repo))):
                    files = "{0}{1}_repo/{2}".format(self.lib_path, repo, f)
                    if os.path.isfile(files):
                        os.remove(files)
                    elif os.path.isdir(files):
                        shutil.rmtree(files)
        Update().repository(only)
837281
function uninstall() {
  installer.uninstall(Array.prototype.slice.call(arguments), function(errs) {
    if (errs) {
      return out.error("error : %j", errs);
    }
    return out.success("plugins uninstalled");
  });
}
103253
function npmInstall() {
  return installer.install(Array.prototype.slice.call(arguments), function(errs) {
    if (errs) {
      return out.error("error : %j", errs);
    }
    return out.success("plugins installed");
  });
}
1212067
def install(force=False):
    """"""
    ret, git_dir, _ = run("git rev-parse --show-toplevel")
    if ret != 0:
        click.echo(
            "ERROR: Please run from within a GIT repository.",
            file=sys.stderr)
        raise click.Abort
    git_dir = git_dir[0]

    hooks_dir = os.path.join(git_dir, HOOK_PATH)

    for hook in HOOKS:
        hook_path = os.path.join(hooks_dir, hook)
        if os.path.exists(hook_path):
            if not force:
                click.echo(
                    "Hook already exists. Skipping {0}".format(hook_path),
                    file=sys.stderr)
                continue
            else:
                os.unlink(hook_path)

        source = os.path.join(sys.prefix, "bin", "kwalitee-" + hook)
        os.symlink(os.path.normpath(source), hook_path)
    return True
1370888
def upgrade_setuptools():
    
    # Note - I tried including the higher version in
    # setup_requires, but was still able to trigger
    # the bug. - stu.axon
    global MIN_SETUPTOOLS
    r = None
    try:
        r = pkg_resources.require(["setuptools"])[0]
    except DistributionNotFound:
        # ok, setuptools will be installed later
        return

    if StrictVersion(r.version) >= StrictVersion(MIN_SETUPTOOLS):
        return
    else:
        print("Upgrading setuptools...")
        subprocess.call("%s -mpip install 'setuptools>=%s'" % (sys.executable, MIN_SETUPTOOLS), shell=True)
542338
public function install_plugins() {

		$result = system(
			WP_PHP_BINARY
			. ' ' . escapeshellarg( dirname( dirname( __FILE__ ) ) . '/bin/install-plugins.php' )
			. ' ' . escapeshellarg( json_encode( $this->plugins ) )
			. ' ' . escapeshellarg( $this->locate_wp_tests_config() )
			. ' ' . (int) is_multisite()
			. ' ' . escapeshellarg( json_encode( $this->files ) )
			, $exit_code
		);

		if ( 0 !== $exit_code ) {
			echo( 'Remote plugin installation failed with exit code ' . $exit_code . PHP_EOL );
			exit( 1 );
		} elseif ( ! empty( $result ) ) {
			echo( PHP_EOL . 'Remote plugin installation produced unexpected output.' . PHP_EOL );
			exit( 1 );
		}

		// The caching functions may not be loaded yet.
		if ( function_exists( 'wp_cache_flush' ) ) {
			wp_cache_flush();
		}

		remove_action( 'all', array( $this, 'install_plugins' ) );
	}
312191
def exclude_package(self, package):
        """"""

        pfx = package + '.'
        if self.packages:
            self.packages = [
                p for p in self.packages
                if p != package and not p.startswith(pfx)
            ]

        if self.py_modules:
            self.py_modules = [
                p for p in self.py_modules
                if p != package and not p.startswith(pfx)
            ]

        if self.ext_modules:
            self.ext_modules = [
                p for p in self.ext_modules
                if p.name != package and not p.name.startswith(pfx)
            ]
12810
private void install() {
        File directory = getNPMDirectory();
        if (directory.isDirectory()) {
            // Check the version
            String version = getVersionFromNPM(directory, log);
            // Are we looking for a specific version ?
            if (npmVersion != null) {
                // Yes
                if (!npmVersion.equals(version)) {
                    log.info("The NPM " + npmName + " is already installed but not in the requested version" +
                            " (requested: " + npmVersion + " - current: " + version + ") - uninstall it");
                    try {
                        FileUtils.deleteDirectory(directory);
                    } catch (IOException e) { //NOSONAR
                        // ignore it.
                    }
                } else {
                    log.debug("NPM " + npmName + " already installed in " + directory.getAbsolutePath() +
                            " (" + version + ")");
                    return;
                }
            } else {
                // No
                log.debug("NPM " + npmName + " already installed in " + directory.getAbsolutePath() + " " +
                        "(" + version + ")");
                return;
            }
        }

        StringBuilder command = new StringBuilder();
        command.append("install ");
        if (installArguments != null) {
            for (String s : installArguments) {
                command.append(s);
                command.append(" ");
            }
        }

        if (npmVersion != null) {
            command.append(npmName).append("@").append(npmVersion);
        } else {
            command.append(npmName);
        }

        try {
            node.factoryForNPMInstallation().getNpmRunner(node.proxy()).execute(command.toString());
        } catch (TaskRunnerException e) {
            log.error("Error during the installation of the NPM " + npmName + " - check log", e);
        }
    }
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])
1330710
def apt_install(packages, options=None, fatal=False):
    """"""
    if options is None:
        options = ['--option=Dpkg::Options::=--force-confold']

    cmd = ['apt-get', '--assume-yes']
    cmd.extend(options)
    cmd.append('install')
    if isinstance(packages, six.string_types):
        cmd.append(packages)
    else:
        cmd.extend(packages)
    log("Installing {} with options: {}".format(packages,
                                                options))
    _run_apt_command(cmd, fatal)
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()
1363873
def install_plugin(username, repo):
    """"""
    print("Installing plugin from " + username + "/" + repo)

    pip.main(['install', '-U', "git+git://github.com/" +
              username + "/" + repo + ".git"])
1220205
def install(editable):
    """"""
    script_dir = str(Path(__file__).parent.abspath())
    click.secho(script_dir, fg='blue')
    if editable:
        sh('pip3 install --editable {0} --upgrade'.format(script_dir))
    else:
        sh('pip3 install {0} --upgrade'.format(script_dir))
755996
def install_from_repo(pkgname, plugin_type, install_path, register_func):
    """"""
    rsession = requests.Session()
    rsession.mount("https://", HTTPAdapter(max_retries=3))

    logger.debug("trying to install %s from online repo", pkgname)
    pkgurl = "{}/{}s/{}.zip".format(defs.GITHUB_RAW, plugin_type, pkgname)
    try:
        logger.debug("Requesting HTTP HEAD: %s", pkgurl)
        r = rsession.head(pkgurl)
        r.raise_for_status()
        total_size = int(r.headers.get("content-length", 0))
        pkgsize = _sizeof_fmt(total_size)
        with click.progressbar(length=total_size, label="Downloading {} {} ({}).."
                               .format(plugin_type, pkgname, pkgsize)) as bar:
            r = rsession.get(pkgurl, stream=True)
            with tempfile.NamedTemporaryFile(delete=False) as f:
                downloaded_bytes = 0
                for chunk in r.iter_content(chunk_size=1):  # TODO: Consider increasing to reduce cycles
                    if chunk:
                        f.write(chunk)
                        downloaded_bytes += len(chunk)
                        bar.update(downloaded_bytes)
        return install_from_zip(f.name, install_path, register_func, delete_after_install=True)
    except requests.exceptions.HTTPError as exc:
        logger.debug(str(exc))
        raise exceptions.PluginNotFoundInOnlineRepo(pkgname)
    except requests.exceptions.ConnectionError as exc:
        logger.debug(str(exc))
        raise exceptions.PluginRepoConnectionError()
559813
def package_ensure_apt(*packages):
    """"""
    package = " ".join(packages)
    status = run("dpkg-query -W -f='${{Status}} ' {p}; true".format(p=package))
    status = status.lower()
    if 'no packages found' in status or 'not-installed' in status:
        sudo("apt-get --yes install " + package)
        return False
    else:
        return True
509495
def install(packages, options=None, fatal=False):
    """"""
    cmd = ['yum', '--assumeyes']
    if options is not None:
        cmd.extend(options)
    cmd.append('install')
    if isinstance(packages, six.string_types):
        cmd.append(packages)
    else:
        cmd.extend(packages)
    log("Installing {} with options: {}".format(packages,
                                                options))
    _run_yum_command(cmd, fatal)