Exemplo n.º 1
0
def search_recipes(cache, pattern=None, ignorecase=True):
    # Conan references in main storage
    if pattern:
        if isinstance(pattern, ConanFileReference):
            pattern = repr(pattern)
        pattern = translate(pattern)
        pattern = re.compile(pattern, re.IGNORECASE) if ignorecase else re.compile(pattern)

    subdirs = list_folder_subdirs(basedir=cache.store, level=4)
    refs = [ConanFileReference.load_dir_repr(folder) for folder in subdirs]
    refs.extend(cache.editable_packages.edited_refs.keys())
    if pattern:
        refs = [r for r in refs if _partial_match(pattern, repr(r))]
    refs = sorted(refs)
    return refs
Exemplo n.º 2
0
 def all_refs(self):
     subdirs = list_folder_subdirs(basedir=self._store_folder, level=4)
     return [ConanFileReference.load_dir_repr(folder) for folder in subdirs]