List all known patches in repos.
180806
def _get_patches(installed_only=False, root=None):
    '''
    
    '''
    patches = {}
    for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'patch').getElementsByTagName('solvable'):
        installed = element.getAttribute('status') == 'installed'
        if (installed_only and installed) or not installed_only:
            patches[element.getAttribute('name')] = {
                'installed': installed,
                'summary': element.getAttribute('summary'),
            }

    return patches
350648
def list_installed():
    '''
    
    '''
    pkg_re = re.compile(r'^{0}-[\d.-]+-{1}$'.format(
        _package_prefix(), _kernel_type()))
    pkgs = __salt__['pkg.list_pkgs'](versions_as_list=True)
    if pkgs is None:
        pkgs = []

    result = list(filter(pkg_re.match, pkgs))
    if result is None:
        return []

    prefix_len = len(_package_prefix()) + 1

    if six.PY2:
        return sorted([pkg[prefix_len:] for pkg in result], cmp=_cmp_version)
    else:
        return sorted([pkg[prefix_len:] for pkg in result], key=functools.cmp_to_key(_cmp_version))
281697
def get_versioned_files(cls):
        """"""
        output = run(['svn', 'st', '-vq', '--xml'], decode=False)
        tree = ET.XML(output)
        return sorted(entry.get('path') for entry in tree.findall('.//entry')
                      if cls.is_interesting(entry))
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])
1253133
def list_(runas=None):
    '''
    
    '''
    ret = []
    output = _rbenv_exec(['install', '--list'], runas=runas)
    if output:
        for line in output.splitlines():
            if line == 'Available versions:':
                continue
            ret.append(line.strip())
    return ret
1231339
def envs(self, ignore_cache=False):
        '''
        
        '''
        if not ignore_cache:
            cache_match = salt.fileserver.check_env_cache(
                self.opts,
                self.env_cache
            )
            if cache_match is not None:
                return cache_match
        ret = set()
        for repo in self.remotes:
            repo_envs = repo.envs()
            for env_list in six.itervalues(repo.saltenv_revmap):
                repo_envs.update(env_list)
            ret.update([x for x in repo_envs if repo.env_is_exposed(x)])
        return sorted(ret)
649602
def _check_repos(self, repos):
        """"""
        self._checking_repos = []
        self._valid_repos = []

        for repo in repos:
            worker = self.download_is_valid_url(repo)
            worker.sig_finished.connect(self._repos_checked)
            worker.repo = repo
            self._checking_repos.append(repo)
238487
def find_diff_violations(self, patch):
        
        violations = collections.defaultdict(list)
        for line in patch.changed_lines:
            file_violations = self._all_violations.get(line['file_name'])
            if not file_violations:
                continue

            line_violations = [v for v in file_violations if v.line == line['line_number']]

            for v in line_violations:
                violations[line['file_name']].append(v)

        return violations
82628
def versions(self) -> List(BlenderVersion):
        

        return [BlenderVersion(tag) for tag in self.git_repo.tags] + [BlenderVersion(BLENDER_VERSION_MASTER)]
1147446
def _get_repo_info(alias, repos_cfg=None, root=None):
    '''
    
    '''
    try:
        meta = dict((repos_cfg or _get_configured_repos(root=root)).items(alias))
        meta['alias'] = alias
        for key, val in six.iteritems(meta):
            if val in ['0', '1']:
                meta[key] = int(meta[key]) == 1
            elif val == 'NONE':
                meta[key] = None
        return meta
    except (ValueError, configparser.NoSectionError):
        return {}
490512
def pkg_version_list(self, pkg_id):
        '''
        
        '''
        pkg_data = self.__reg_software.get(pkg_id, None)
        if not pkg_data:
            return []

        if isinstance(pkg_data, list):
            # raw data is 'pkgid': [sorted version list]
            return pkg_data  # already sorted oldest to newest

        # Must be a dict or OrderDict, and contain full details
        installed_versions = list(pkg_data.get('version').keys())
        return sorted(installed_versions, key=cmp_to_key(self.__oldest_to_latest_version))
233227
def _versions_from_changelog(changelog):
    
    versions = [Version(x) for x in changelog if BUGFIX_RELEASE_RE.match(x)]
    return sorted(versions)
378828
def get_repos(self):
        
        return github.PaginatedList.PaginatedList(
            github.Repository.Repository,
            self._requester,
            self.url + "/repos",
            None
        )
831248
def repos(self):
        
        def_cnt, cus_cnt = 0, 0
        print("")
        self.msg.template(78)
        print("{0}{1}{2}{3}{4}{5}{6}".format(
            "| Repo id", " " * 2,
            "Repo URL", " " * 44,
            "Default", " " * 3,
            "Status"))
        self.msg.template(78)
        for repo_id, repo_URL in sorted(self.all_repos.iteritems()):
            status, COLOR = "disabled", self.meta.color["RED"]
            default = "yes"
            if len(repo_URL) > 49:
                repo_URL = repo_URL[:48] + "~"
            if repo_id in self.meta.repositories:
                def_cnt += 1
                status, COLOR = "enabled", self.meta.color["GREEN"]
            if repo_id not in self.meta.default_repositories:
                cus_cnt += 1
                default = "no"
            print("  {0}{1}{2}{3}{4}{5}{6}{7:>8}{8}".format(
                repo_id, " " * (9 - len(repo_id)),
                repo_URL, " " * (52 - len(repo_URL)),
                default, " " * (8 - len(default)),
                COLOR, status, self.meta.color["ENDC"]))

        print("\nRepositories summary")
        print("=" * 79)
        print("{0}{1}/{2} enabled default repositories and {3} custom.".format(
            self.meta.color["GREY"], def_cnt, len(self.all_repos), cus_cnt))
        print("Edit the file '/etc/slpkg/repositories.conf' for enable "
              "and disable default\nrepositories or run 'slpkg "
              "repo-enable' command.\n{0}".format(self.meta.color["ENDC"]))
        raise SystemExit()
950819
def all_packages(self):
        """"""
        p = dict(self.parsed_pipfile.get("dev-packages", {}))
        p.update(self.parsed_pipfile.get("packages", {}))
        return p
1282078
def list_lib(self, repo):
        
        packages = ""
        if repo == "sbo":
            if (os.path.isfile(
                    self.meta.lib_path + "{0}_repo/SLACKBUILDS.TXT".format(
                        repo))):
                packages = Utils().read_file(self.meta.lib_path + "{0}_repo/"
                                             "SLACKBUILDS.TXT".format(repo))
        else:
            if (os.path.isfile(
                    self.meta.lib_path + "{0}_repo/PACKAGES.TXT".format(repo))):
                packages = Utils().read_file(self.meta.lib_path + "{0}_repo/"
                                             "PACKAGES.TXT".format(repo))
        return packages
559317
def repositories(self):
        
        if self.repo == "sbo":
            self.sbo_case_insensitive()
            self.find_pkg = sbo_search_pkg(self.name)
            if self.find_pkg:
                self.dependencies_list = Requires(self.flag).sbo(self.name)
        else:
            PACKAGES_TXT = Utils().read_file(
                self.meta.lib_path + "{0}_repo/PACKAGES.TXT".format(self.repo))
            self.names = Utils().package_name(PACKAGES_TXT)
            self.bin_case_insensitive()
            self.find_pkg = search_pkg(self.name, self.repo)
            if self.find_pkg:
                self.black = BlackList().packages(self.names, self.repo)
                self.dependencies_list = Dependencies(
                    self.repo, self.black).binary(self.name, self.flag)