Remove a ProductVersion from association with a BuildConfiguration
517784
def remove_product_version_from_build_configuration(id=None, name=None, product_version_id=None):
    
    data = remove_product_version_from_build_configuration_raw(id, name, product_version_id)
    if data:
        return utils.format_json_list(data)
1095705
function replacePropagatingVersions(uri, data) {
  if (references.isPropagatingVersion(uri)) {
    references.replaceAllVersions(uri.split('@')[1])(data);
  }

  return data;
}
1358101
def cmd_version(unused_conf):
    """"""
    import pkg_resources
    print('This is {} version {}, imported from {}'
          .format(__oneliner__, __version__, __file__))
    if len(Plugin.builders) > 0:
        print('setuptools registered builders:')
    for entry_point in pkg_resources.iter_entry_points('yabt.builders'):
        print('  {0.module_name}.{0.name} (dist {0.dist})'.format(entry_point))
1310271
function convertForPackage(context, pkg) {
	var name = pkg.name;
	var version = pkg.version;

	var conv = context.deferredConversions;
	var pkgConv = conv[name];
	var depPkg, fns, keys = 0;
	if(pkgConv) {
		for(var range in pkgConv) {
			depPkg = crawl.matchedVersion(context, name, range);
			if(depPkg) {
				fns = pkgConv[range];
				for(var i = 0, len = fns.length; i < len; i++) {
					fns[i].call(context);
				}
				delete pkgConv[range];
			} else {
				keys++;
			}
		}
		if(keys === 0) {
			delete conv[name];
		}
	}
}
257102
def _prepare_version(self):
        """"""
        if config.VERSION not in self._config:
            self._config[config.VERSION] = __version__
1258043
def do_upgrade(self):
        """"""
        sql = text('delete from upgrade where upgrade = :upgrade')
        db.engine.execute(
            sct(ql, upgrade='invenio_upgrader_2015_11_12_innodb_removal'))
26238
function replaceVersionsObservable(name, versions) {
  return Observable.create((observer) => {
    const package = getSrcPackageFile(name);
    let pkg = readFileSync(package, 'utf8');
    const regexs = Object.keys(versions).map(key =>
      ({ expr: new RegExp(key, 'g'), key, val: versions[key] }));
    regexs.forEach(reg => {
      pkg = pkg.replace(reg.expr, reg.val);
    });
    const outPath = getDestPackageFile(name);
    writeFile(outPath, pkg, err => {
      if (err) {
        observer.error(err);
      } else {
        observer.next(pkg);
        observer.complete();
      }
    });
  });
}
585350
private void deleteAllConfiguredApplications() {
        try {
            Configuration[] configs = configAdmin.listConfigurations("(&(service.factoryPid=" + AppManagerConstants.APPLICATIONS_PID + ")("
                                                                     + AppManagerConstants.AUTO_INSTALL_PROP + "=true))");
            if (configs != null) {
                for (Configuration c : configs) {
                    try {
                        c.delete();
                    } catch (Exception e) {
                        // Move on, but FFDC
                    }
                }
            }
        } catch (IOException e) {
            // Hmm, I guess this is a bad place to be, not sure what to do. I guess I just FFDC and move on.
            // A clean start will fix this issue.
        } catch (InvalidSyntaxException e) {
            // This should never happen, if it does we want the FFDC
        }
    }
427308
def remove_release(self, username, package_name, version):
        '''
        
        '''
        url = '%s/release/%s/%s/%s' % (self.domain, username, package_name, version)
        res = self.session.delete(url)
        self._check_response(res, [201])
        return
442932
def _uninstall(
    action='remove',
    name=None,
    version=None,
    pkgs=None,
    normalize=True,
    ignore_epoch=False,
    **kwargs):
    '''
    
    '''
    if action not in ('remove', 'purge'):
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': 'Invalid action \'{0}\'. '
                           'This is probably a bug.'.format(action)}

    try:
        pkg_params = __salt__['pkg_resource.parse_targets'](
            name,
            pkgs,
            normalize=normalize)[0]
    except MinionError as exc:
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': 'An error was encountered while parsing targets: '
                           '{0}'.format(exc)}
    targets = _find_remove_targets(name, version, pkgs, normalize,
                                   ignore_epoch=ignore_epoch, **kwargs)
    if isinstance(targets, dict) and 'result' in targets:
        return targets
    elif not isinstance(targets, list):
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': 'An error was encountered while checking targets: '
                           '{0}'.format(targets)}
    if action == 'purge':
        old_removed = __salt__['pkg.list_pkgs'](versions_as_list=True,
                                                removed=True,
                                                **kwargs)
        targets.extend([x for x in pkg_params if x in old_removed])
    targets.sort()

    if not targets:
        return {'name': name,
                'changes': {},
                'result': True,
                'comment': 'None of the targeted packages are installed'
                           '{0}'.format(' or partially installed'
                                        if action == 'purge' else '')}

    if __opts__['test']:
        return {'name': name,
                'changes': {},
                'result': None,
                'comment': 'The following packages will be {0}d: '
                           '{1}.'.format(action, ', '.join(targets))}

    changes = __salt__['pkg.{0}'.format(action)](name, pkgs=pkgs, version=version, **kwargs)
    new = __salt__['pkg.list_pkgs'](versions_as_list=True, **kwargs)
    failed = []
    for x in pkg_params:
        if __grains__['os_family'] in ['Suse', 'RedHat']:
            # Check if the package version set to be removed is actually removed:
            if x in new and not pkg_params[x]:
                failed.append(x)
            elif x in new and pkg_params[x] in new[x]:
                failed.append(x + "-" + pkg_params[x])
        elif x in new:
            failed.append(x)

    if action == 'purge':
        new_removed = __salt__['pkg.list_pkgs'](versions_as_list=True,
                                                removed=True,
                                                **kwargs)
        failed.extend([x for x in pkg_params if x in new_removed])
    failed.sort()

    if failed:
        return {'name': name,
                'changes': changes,
                'result': False,
                'comment': 'The following packages failed to {0}: '
                           '{1}.'.format(action, ', '.join(failed))}

    comments = []
    not_installed = sorted([x for x in pkg_params if x not in targets])
    if not_installed:
        comments.append('The following packages were not installed: '
                        '{0}'.format(', '.join(not_installed)))
        comments.append('The following packages were {0}d: '
                        '{1}.'.format(action, ', '.join(targets)))
    else:
        comments.append('All targeted packages were {0}d.'.format(action))

    return {'name': name,
            'changes': changes,
            'result': True,
            'comment': ' '.join(comments)}
770341
def update_build_configuration_set(id, **kwargs):
    
    data = update_build_configuration_set_raw(id, **kwargs)
    if data:
        return utils.format_json(data)
492079
def clean(self):
        
        for prop in ('imported_from', 'use', 'plus', 'templates', 'register'):
            try:
                delattr(self, prop)
            except AttributeError:
                pass
        for prop in ('configuration_warnings', 'configuration_errors'):
            try:
                if getattr(self, prop, None) is not None and not getattr(self, prop):
                    delattr(self, prop)
            except AttributeError:
                pass
312995
public void removeTangoAttConfigListener(ITangoAttConfigListener listener)
            throws DevFailed {
        event_listeners.remove(ITangoAttConfigListener.class, listener);
        if (event_listeners.size() == 0)
            unsubscribe_event(event_identifier);
    }
867385
def yank_version(name, version, options = {})
      ensure_ready!(:authorization)
      url = "gems/#{escape(name)}/versions/#{escape(version)}"
      response = connection.delete(url, options)
      checked_response_body(response)
    end
97232
def _strip_feature_version(featureid):
    
    version_detector = re.compile(r"(?P<featureid>.*)(?P<version>\.\d+)")
    match = version_detector.match(featureid)
    if match:
        return match.groupdict()["featureid"]
    else:
        return featureid
1076045
def _delete_version(self, symbol, version_num, do_cleanup=True):
        
        version = self._versions.find_one({'symbol': symbol, 'version': version_num})
        if not version:
            logger.error("Can't delete %s:%s as not found in DB" % (symbol, version_num))
            return
        # If the version is pointed to by a snapshot, then can't delete
        if version.get('parent', None):
            for parent in version['parent']:
                snap_name = self._snapshots.find_one({'_id': parent})
                if snap_name:
                    snap_name = snap_name['name']
                logger.error("Can't delete: %s:%s as pointed to by snapshot: %s" % (symbol, version['version'],
                                                                                    snap_name))
                return
        self._versions.delete_one({'_id': version['_id']})
        # TODO: for FW pointers, if the above statement fails, they we have no way to delete the orphaned segments.
        #       This would be possible only via FSCK, or by moving the above statement at the end of this method,
        #       but with the risk of failing to delelte the version catastrophically, and ending up with a corrupted v.
        if do_cleanup:
            cleanup(self._arctic_lib, symbol, [version['_id']], self._versions,
                    shas_to_delete=tuple(bson.binary.Binary(s) for s in version.get(FW_POINTERS_REFS_KEY, [])),
                    pointers_cfgs=(get_fwptr_config(version), ))
308126
def list_build_configurations_for_product_version(product_id, version_id, page_size=200, page_index=0, sort="", q=""):
    
    data = list_build_configurations_for_project_raw(product_id, version_id, page_size, page_index, sort, q)
    if data:
        return utils.format_json_list(data)