Update packages (info page)
778189
public function updateAction()
    {
        $model = $this->getServiceLocator()
                      ->get( 'Grid\Core\Model\Package\Model' );

        if ( ! $model->getEnabledPackageCount() )
        {
            $this->getResponse()
                 ->setStatusCode( 404 );

            return;
        }

        if ( ! $model->canModify() )
        {
            $this->getResponse()
                 ->setStatusCode( 403 );

            return;
        }

        return array();
    }
558772
def update_apt(days=3, upgrade=False):
    """"""
    # Check the apt-get update timestamp (works on Ubuntu only)
    with settings(warn_only=True):
        last_update = run(
            "stat -c %Y /var/lib/apt/periodic/update-success-stamp")
    if ('cannot stat' in last_update
            or (time.time() - float(last_update)) > days * 86400):
        sudo("apt-get --yes update")
        if upgrade:
            sudo("apt-get --yes upgrade")
1058341
function updateSidebar() {

    var sidebarJSONPath = path.resolve(rootDir, srcSidebar);
    const sidebarText = fs.readFileSync(sidebarJSONPath).toString();
    var sidebarJSON = JSON.parse(sidebarText);
    sidebarJSON.docs.Packages = [];

    sidebarEntries
        .map((entry) => sidebarJSON.docs.Packages.push(entry))

    if (dryRun) {
        console.log("In website/sidebars.json, this script updates...\n" +
            "...the Packages array with the filepath to each package's index file.");
    } else {
        fs.writeFile(sidebarJSONPath, JSON.stringify(sidebarJSON, null, 2), 'utf8', (err) => {
            if (err) throw err;
            console.log(chalk.green(`${srcSidebar} was succesfully updated!`));
        }); 
    }

}
370957
def run_outdated(cls, options):
        """"""
        latest_versions = sorted(
            cls.find_packages_latest_versions(cls.options),
            key=lambda p: p[0].project_name.lower())

        for dist, latest_version, typ in latest_versions:
            if latest_version > dist.parsed_version:
                if options.all:
                    pass
                elif options.pinned:
                    if cls.can_be_updated(dist, latest_version):
                        continue
                elif not options.pinned:
                    if not cls.can_be_updated(dist, latest_version):
                        continue
                    elif options.update:
                        print(dist.project_name if options.brief else
                              'Updating %s to Latest: %s [%s]' %
                              (cls.output_package(dist), latest_version, typ))
                        main(['install', '--upgrade'] + ([
                            '--user'
                        ] if ENABLE_USER_SITE else []) + [dist.key])
                        continue

                print(dist.project_name if options.brief else
                      '%s - Latest: %s [%s]' %
                      (cls.output_package(dist), latest_version, typ))
307237
def uptodate():
    '''
    
    '''
    DETAILS = _load_state()
    for p in DETAILS['packages']:
        version_float = float(DETAILS['packages'][p])
        version_float = version_float + 1.0
        DETAILS['packages'][p] = six.text_type(version_float)
    return DETAILS['packages']
799037
def update(connection, force_download):
    """"""
    manager.database.update(
        connection=connection,
        force_download=force_download
    )
1012847
def update_package_files(srcdir, extensions, package_data, packagenames,
                         package_dirs):
    

    info = get_package_info(srcdir)
    extensions.extend(info['ext_modules'])
    package_data.update(info['package_data'])
    packagenames = list(set(packagenames + info['packages']))
    package_dirs.update(info['package_dir'])
1165813
function updatePackageInfo(theme, version) {
  const cwd = `.tmp/${version}/${theme}/publish`
  bower.version = `${version}-${theme}`
  pkg.version = `${version}-${theme}`
  return Promise.all([
    fs.writeFile(`${cwd}/bower.json`, JSON.stringify(bower, null, 4)),
    fs.writeFile(`${cwd}/package.json`, JSON.stringify(pkg, null, 4))
  ])
}
1371593
def upgrade():
    """"""
    with op.batch_alter_table('accounts_user_session_activity') as batch_op:
        batch_op.add_column(sa.Column('browser', sa.String(80), nullable=True))
        batch_op.add_column(
            sa.Column('browser_version', sa.String(30), nullable=True))
        batch_op.add_column(
            sa.Column('country', sa.String(3), nullable=True))
        batch_op.add_column(
            sa.Column('device', sa.String(80), nullable=True))
        batch_op.add_column(
            sa.Column('ip', sa.String(80), nullable=True))
        batch_op.add_column(
            sa.Column('os', sa.String(80), nullable=True))
929319
def available_updates(self, obj):
        """"""
        from package_monitor import pypi
        package = pypi.Package(obj.package_name)
        versions = package.all_versions()
        return html_list([v for v in versions if v > obj.current_version])
1324876
def update_source_list(self):
        
        with cd('/etc/apt'):
            sudo('mv sources.list sources.list.bak')
            put(StringIO(bigdata_conf.ubuntu_source_list_16),
                'sources.list', use_sudo=True)
            sudo('apt-get update -y --fix-missing')
901711
def apt_upgrade(options=None, fatal=False, dist=False):
    """"""
    if options is None:
        options = ['--option=Dpkg::Options::=--force-confold']

    cmd = ['apt-get', '--assume-yes']
    cmd.extend(options)
    if dist:
        cmd.append('dist-upgrade')
    else:
        cmd.append('upgrade')
    log("Upgrading with options: {}".format(options))
    _run_apt_command(cmd, fatal)
592956
def _update_version_data(self, result, info):
        
        name = info.pop('name')
        version = info.pop('version')
        if version in result:
            dist = result[version]
            md = dist.metadata
        else:
            dist = make_dist(name, version, scheme=self.scheme)
            md = dist.metadata
        dist.digest = self._get_digest(info)
        if md.source_url != info['url']:
            md.source_url = self.prefer_url(md.source_url, info['url'])
        dist.locator = self
        result[version] = dist
1017314
def update_command(args):
    """"""
    updated = update_requirements_file(
        args.requirements_file, args.skip_packages)

    if updated:
        print('Updated requirements in {}:'.format(args.requirements_file))

        for item in updated:
            print(' * {} from {} to {}.'.format(*item))
    else:
        print('All dependencies in {} are up-to-date.'.format(
            args.requirements_file))
522994
def pkg_install(self):
        
        flag = []
        options = [
            "-s",
            "--sync"
        ]
        additional_options = [
            "--resolve-off",
            "--download-only",
            "--directory-prefix=",
            "--case-ins",
            "--rebuild",
            "--reinstall",
            "--patches"
        ]
        for arg in self.args:
            if arg.startswith(additional_options[2]):
                flag.append(arg)
                arg = ""
            if arg in additional_options:
                flag.append(arg)
        # clean from flags
        for ar in flag:
            if ar in self.args:
                self.args.remove(ar)
        if len(self.args) >= 3 and self.args[0] in options:
            if (self.args[1] in self.meta.repositories and
                    self.args[1] not in ["sbo"]):
                BinaryInstall(self.args[2:], self.args[1], flag).start(
                    is_upgrade=False)
            elif (self.args[1] == "sbo" and
                    self.args[1] in self.meta.repositories):
                SBoInstall(self.args[2:], flag).start(is_upgrade=False)
            else:
                usage(self.args[1])
        else:
            usage("")
871662
def update_req(req):
    """"""

    if not req.name:
        return req, None

    info = get_package_info(req.name)

    if info['info'].get('_pypi_hidden'):
        print('{} is hidden on PyPI and will not be updated.'.format(req))
        return req, None

    if _is_pinned(req) and _is_version_range(req):
        print('{} is pinned to a range and will not be updated.'.format(req))
        return req, None

    newest_version = _get_newest_version(info)
    current_spec = next(iter(req.specifier)) if req.specifier else None
    current_version = current_spec.version if current_spec else None
    new_spec = Specifier(u'=={}'.format(newest_version))
    if not current_spec or current_spec._spec != new_spec._spec:
        req.specifier = new_spec
        update_info = (
            req.name,
            current_version,
            newest_version)
        return req, update_info
    return req, None
510459
function updateVersion () {
    start(`Updating ${"package.json".cyan} version from ${oldVersion.cyan} to ${newVersion.cyan}...`);
    pkg.version = newVersion;
    fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
    done();
    abortCmds.push('git checkout package.json');
    pushCmds.push('git add package.json');
  }