def _collect(self): self._non_private_cp_to_atoms = defaultdict(list) self._private_cp_to_atoms = defaultdict(list) self._total_count = 0 self._private_count = 0 for location in self._locations(): for x in portage.grabfile_package(os.path.join( location, self._section), recursive=1): self._total_count = self._total_count + 1 if x.startswith('-'): print ' no proper support for "-cat/pkg" style entry "%s" yet, sorry.' % x.strip( ) continue cp = get_cp(x) if self._privacy_filter and is_private_package_atom(cp): self._private_count = self._private_count + 1 dict_ref = self._private_cp_to_atoms else: dict_ref = self._non_private_cp_to_atoms merge_with = set([x]) if cp in dict_ref: dict_ref[cp] = dict_ref[cp].union(merge_with) else: dict_ref[cp] = merge_with
def scan_profile(path): if "grab_stacked" in dir(portage): return portage.grab_stacked(path, portage.settings.profiles, portage.grabfile, incremental_lines=1) else: if "grab_multiple" in dir(portage): return portage.stack_lists(portage.grab_multiple(path, portage.settings.profiles, portage.grabfile), incremental=1) else: return portage.stack_lists([portage.grabfile_package(os.path.join(x, path)) for x in portage.settings.profiles], incremental=1)
def _collect(self): self._non_private_cp_to_atoms = defaultdict(list) self._private_cp_to_atoms = defaultdict(list) self._total_count = 0 self._private_count = 0 for location in self._locations(): for x in portage.grabfile_package( os.path.join(location, self._section), recursive = 1): self._total_count = self._total_count + 1 if x.startswith('-'): print ' no proper support for "-cat/pkg" style entry "%s" yet, sorry.' % x.strip() continue cp = get_cp(x) if self._privacy_filter and is_private_package_atom(cp): self._private_count = self._private_count + 1 dict_ref = self._private_cp_to_atoms else: dict_ref = self._non_private_cp_to_atoms merge_with = set([x]) if cp in dict_ref: dict_ref[cp] = dict_ref[cp].union(merge_with) else: dict_ref[cp] = merge_with
def scan_profile(file): return portage.stack_lists([ portage.grabfile_package(os.path.join(x, file)) for x in portage.settings.profiles ], incremental=1)
def scan_profile(file): return portage.stack_lists( [portage.grabfile_package(os.path.join(x, file)) for x in portage.settings.profiles], incremental=1);