Upgrade locked dependency versions
191963
def verify(ctx):
    """"""
    oks = run_configurations(
        skipper(verify_environments),
        read_sections,
    )
    ctx.exit(0
             if False not in oks
             else 1)
1254148
def dependency_versions(args = {}, &bl)
      versions = {}
      args = {:recursive => true, :dev_deps  => true, :versions => versions}.merge(args)
      deps.each do |dep|
        gem = Polisher::Gem.retrieve(dep.name)
        versions.merge!(gem.versions(args, &bl))
      end
      versions
    end
435620
def upgrade():
    """"""
    op.create_table(
        'access_actionssystemroles',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('role_name', sa.String(length=40), nullable=False),
        sa.PrimaryKeyConstraint('id',
                                name=op.f('pk_access_actionssystemroles')),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'role_name',
                            name='access_actionssystemroles_unique')
    )
    op.create_index(op.f('ix_access_actionssystemroles_action'),
                    'access_actionssystemroles', ['action'], unique=False)
    op.create_index(op.f('ix_access_actionssystemroles_argument'),
                    'access_actionssystemroles', ['argument'], unique=False)
    op.create_index(op.f('ix_access_actionssystemroles_role_name'),
                    'access_actionssystemroles', ['role_name'], unique=False)
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))
179830
def upgrade():
    """"""
    op.execute('COMMIT')  # See https://bitbucket.org/zzzeek/alembic/issue/123
    ctx = op.get_context()
    metadata = ctx.opts['target_metadata']
    metadata.naming_convention = NAMING_CONVENTION
    metadata.bind = ctx.connection.engine
    insp = Inspector.from_engine(ctx.connection.engine)

    for table_name in insp.get_table_names():
        if table_name not in metadata.tables:
            continue

        table = metadata.tables[table_name]

        ixs = {}
        uqs = {}
        fks = {}

        for ix in insp.get_indexes(table_name):
            ixs[tuple(ix['column_names'])] = ix
        for uq in insp.get_unique_constraints(table_name):
            uqs[tuple(uq['column_names'])] = uq
        for fk in insp.get_foreign_keys(table_name):
            fks[(tuple(fk['constrained_columns']), fk['referred_table'])] = fk

        with op.batch_alter_table(
                table_name, naming_convention=NAMING_CONVENTION) as batch_op:
            for c in list(table.constraints) + list(table.indexes):
                key = None
                if isinstance(c, sa.schema.ForeignKeyConstraint):
                    key = (tuple(c.column_keys), c.referred_table.name)
                    fk = fks.get(key)
                    if fk and c.name != fk['name']:
                        batch_op.drop_constraint(
                            fk['name'], type_='foreignkey')
                        batch_op.create_foreign_key(
                            op.f(c.name), fk['referred_table'],
                            fk['constrained_columns'],
                            fk['referred_columns'],
                            **fk['options']
                        )
                elif isinstance(c, sa.schema.UniqueConstraint):
                    key = tuple(c.columns.keys())
                    uq = uqs.get(key)
                    if uq and c.name != uq['name']:
                        batch_op.drop_constraint(uq['name'], type_='unique')
                        batch_op.create_unique_constraint(
                            op.f(c.name), uq['column_names'])
                elif isinstance(c, sa.schema.CheckConstraint):
                    util.warn('Update {0.table.name} CHECK {0.name} '
                              'manually'.format(c))
                elif isinstance(c, sa.schema.Index):
                    key = tuple(c.columns.keys())
                    ix = ixs.get(key)
                    if ix and c.name != ix['name']:
                        batch_op.drop_index(ix['name'])
                        batch_op.create_index(
                            op.f(c.name), ix['column_names'],
                            unique=ix['unique'],
                        )
                elif isinstance(c, sa.schema.PrimaryKeyConstraint) or \
                        c.name == '_unnamed_':
                    # NOTE we don't care about primary keys since they have
                    # specific syntax.
                    pass
                else:
                    raise RuntimeError('Missing {0!r}'.format(c))
489406
function (pkg, cb) {
  var auto = npm.config.get("update-dependents")
  if (!auto) {
    autoUpdate = function (_, cb) { return cb() }
    return log.verbose(
      "update-dependents disabled by config", "update-dependents", cb)
  }
  pkg = pkg && pkg._data || pkg
  if (auto === "always") {
    return npm.commands["update-dependents"]([pkg], cb)
  }
  readInstalled(pkg.name, function (er, inst) {
    if (er) return cb(er)
    var versions = Object.keys(inst[pkg.name])
                   .filter(function (v) { return v !== pkg.version })
                   .sort(semver.sort)
      , maxHave = versions.pop()
    if (!maxHave) return cb()
    if (!semver.gt(pkg.version, maxHave)) return log.verbose(
      "downgrade, not updating dependencencies", "update-dependents", cb)
    npm.commands["update-dependents"]([pkg], cb)
  })
}
1266787
public final void unlockFromUpgrade(L locker) {
        int upgradeCount = mUpgradeCount - 1;
        if (upgradeCount < 0) {
            throw new IllegalMonitorStateException("Too many upgrade locks released");
        }
        if (upgradeCount == 0 && mWriteCount > 0) {
            // Don't release last upgrade lock and switch write lock to
            // automatic upgrade mode.
            clearUpgradeLock(mState);
            return;
        }
        mUpgradeCount = upgradeCount;
        if (upgradeCount > 0) {
            return;
        }

        mOwner = null;

        // keep looping on CAS failure if reader mucked with state
        while (!clearUpgradeLock(mState)) {}

        Node h = mUHead;
        if (h != null && h.mWaitStatus != 0) {
            unparkUpgradeSuccessor(h);
        }
    }
561896
def upgradestep(upgrade_product, version):
    
    def wrap_func(fn):
        def wrap_func_args(context, *args):
            p = getToolByName(context, 'portal_quickinstaller').get(upgrade_product)
            setattr(p, 'installedversion', version)
            return fn(context, *args)
        return wrap_func_args
    return wrap_func
290459
def pre_upgrade(self):
        """"""
        sql = text('select 1 from upgrade where upgrade = :upgrade')
        if not db.engine.execute(
            sql, upgrade='invenio_upgrader_2015_11_12_innodb_removal'
           ).fetchall():
            warnings.warn("Upgrade '{}' was not applied.".format(
                'invenio_upgrader_2015_11_12_innodb_removal'))
366471
def update_release_version():
    """"""
    version = get_version(pep440=True)
    with open(VERSION_FILE, "w") as outfile:
        outfile.write(version)
        outfile.write("\n")
95481
def pkg_upgrade(self):
        
        options = [
            "-c",
            "--check"
        ]
        flags = [
            "--upgrade",
            "--skip=",
            "--resolve-off",
            "--checklist",
            "--rebuild"
        ]
        flag, skip = self.__pkg_upgrade_flags(flags)
        if (len(self.args) == 3 and self.args[0] in options and
                self.args[2] == flags[0] and
                self.args[1] in self.meta.repositories):
            if self.args[1] not in ["slack", "sbo"]:
                BinaryInstall(pkg_upgrade(self.args[1], skip, flag),
                              self.args[1], flag).start(is_upgrade=True)
            elif self.args[1] == "slack":
                if self.meta.only_installed in ["on", "ON"]:
                    BinaryInstall(pkg_upgrade("slack", skip, flag),
                                  "slack", flag).start(is_upgrade=True)
                else:
                    Patches(skip, flag).start()
            elif self.args[1] == "sbo":
                SBoInstall(sbo_upgrade(skip, flag), flag).start(is_upgrade=True)
            else:
                usage(self.args[1])
        elif len(self.args) == 2 and self.args[0] in options:
            if self.args[1] == "ALL":
                Updates(repo="").ALL()
            else:
                Updates(self.args[1]).run()
        elif (len(self.args) >= 2 and self.args[0] in options and
                self.args[1] not in self.meta.repositories):
            usage(self.args[1])
        else:
            usage("")
14110
def update(
    ctx,
    state,
    bare=False,
    dry_run=None,
    outdated=False,
    **kwargs
):
    """"""
    from ..core import (
        ensure_project,
        do_outdated,
        do_lock,
        do_sync,
        project,
    )

    ensure_project(three=state.three, python=state.python, warn=True, pypi_mirror=state.pypi_mirror)
    if not outdated:
        outdated = bool(dry_run)
    if outdated:
        do_outdated(pypi_mirror=state.pypi_mirror)
    packages = [p for p in state.installstate.packages if p]
    editable = [p for p in state.installstate.editables if p]
    if not packages:
        echo(
            "{0} {1} {2} {3}{4}".format(
                crayons.white("Running", bold=True),
                crayons.red("$ pipenv lock", bold=True),
                crayons.white("then", bold=True),
                crayons.red("$ pipenv sync", bold=True),
                crayons.white(".", bold=True),
            )
        )
    else:
        for package in packages + editable:
            if package not in project.all_packages:
                echo(
                    "{0}: {1} was not found in your Pipfile! Aborting."
                    "".format(
                        crayons.red("Warning", bold=True),
                        crayons.green(package, bold=True),
                    ),
                    err=True,
                )
                ctx.abort()

    do_lock(
        clear=state.clear,
        pre=state.installstate.pre,
        keep_outdated=state.installstate.keep_outdated,
        pypi_mirror=state.pypi_mirror,
    )
    do_sync(
        ctx=ctx,
        dev=state.installstate.dev,
        three=state.three,
        python=state.python,
        bare=bare,
        dont_upgrade=not state.installstate.keep_outdated,
        user=False,
        clear=state.clear,
        unused=False,
        sequential=state.installstate.sequential,
        pypi_mirror=state.pypi_mirror,
    )
775271
def check_pypi_updates(dependencies):
    """"""
    dependencies_up_to_date = []
    for dependency in dependencies.get('pypi', []):
        # get latest version from PyPI api
        try:
            latest_version = get_latest_version_number(dependency.project_name)
        except Exception as error:
            logger.warning("--check-updates command will be aborted. Error: %s", error)
            return dependencies
        # get required version
        required_version = None
        if dependency.specs:
            _, required_version = dependency.specs[0]

        if required_version:
            dependencies_up_to_date.append(dependency)
            if latest_version > required_version:
                logger.info("There is a new version of %s: %s",
                            dependency.project_name, latest_version)
            elif latest_version < required_version:
                logger.warning("The requested version for %s is greater "
                               "than latest found in PyPI: %s",
                               dependency.project_name, latest_version)
            else:
                logger.info("The requested version for %s is the latest one in PyPI: %s",
                            dependency.project_name, latest_version)
        else:
            project_name_plus = "{}=={}".format(dependency.project_name, latest_version)
            dependencies_up_to_date.append(pkg_resources.Requirement.parse(project_name_plus))
            logger.info("The latest version of %r is %s and will use it.",
                        dependency.project_name, latest_version)

    dependencies["pypi"] = dependencies_up_to_date
    return dependencies
1081698
function getUpdatedDeps (pkg, cb) {
  var opts = {
    stable: !argv.unstable,
    loose: true,
    error: {
      E404: argv.error404,
      ESCM: argv.errorSCM,
      EDEPTYPE: argv.errorDepType
    },
    ignore: argv.ignore || argv.i
  }

  if (argv.registry) {
    opts.npm = {registry: argv.registry}
  }

  david.getUpdatedDependencies(pkg, opts, function (err, deps) {
    if (err) return cb(err)

    david.getUpdatedDependencies(pkg, xtend(opts, {dev: true}), function (err, devDeps) {
      if (err) return cb(err)

      david.getUpdatedDependencies(pkg, xtend(opts, {optional: true}), function (err, optionalDeps) {
        cb(err, filterDeps(deps), filterDeps(devDeps), filterDeps(optionalDeps))
      })
    })
  })
}
1092791
def upgrade():
    """"""
    op.create_table(
        'oauthclient_remoteaccount',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('user_id', sa.Integer(), nullable=False),
        sa.Column('client_id', sa.String(length=255), nullable=False),
        sa.Column(
            'extra_data',
            sqlalchemy_utils.JSONType(),
            nullable=False),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('user_id', 'client_id')
    )
    op.create_table(
        'oauthclient_useridentity',
        sa.Column('id', sa.String(length=255), nullable=False),
        sa.Column('method', sa.String(length=255), nullable=False),
        sa.Column('id_user', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(['id_user'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id', 'method')
    )
    op.create_index(
        'useridentity_id_user_method', 'oauthclient_useridentity',
        ['id_user', 'method'], unique=True
    )
    op.create_table(
        'oauthclient_remotetoken',
        sa.Column('id_remote_account', sa.Integer(), nullable=False),
        sa.Column('token_type', sa.String(length=40), nullable=False),
        sa.Column(
            'access_token',
            sqlalchemy_utils.EncryptedType(),
            nullable=False),
        sa.Column('secret', sa.Text(), nullable=False),
        sa.ForeignKeyConstraint(
            ['id_remote_account'], [u'oauthclient_remoteaccount.id'],
            name='fk_oauthclient_remote_token_remote_account'
        ),
        sa.PrimaryKeyConstraint('id_remote_account', 'token_type')
    )
448034
def release(path, repository):
    """"""
    upgrader = InvenioUpgrader()
    logger = upgrader.get_logger()

    try:
        endpoints = upgrader.find_endpoints()

        if not endpoints:
            logger.error("No upgrades found.")
            click.Abort()

        depends_on = []
        for repo, upgrades in endpoints.items():
            depends_on.extend(upgrades)

        return recipe(path,
                      repository=repository,
                      depends_on=depends_on,
                      release=True,
                      output_path=output_path)

    except RuntimeError as e:
        for msg in e.args:
            logger.error(unicode(msg))
        raise
117807
def upgrade_available(name):
    '''
    
    '''
    version_num = None
    cmd = '/opt/csw/bin/pkgutil -c --parse --single {0}'.format(
        name)
    out = __salt__['cmd.run_stdout'](cmd)
    if out:
        version_num = out.split()[2].strip()
    if version_num:
        if version_num == "SAME":
            return ''
        else:
            return version_num
    return ''