def recheck_hidden(self, pkg): """ Prevent USE_EXPAND_HIDDEN flags from being hidden if they are the only thing that triggered reinstallation. @param pkg: _emerge.Package.Package instance Modifies self.use_expand_hidden, self.use_expand, self.verboseadd """ reinst_flags_map = {} reinstall_for_flags = self.conf.reinstall_nodes.get(pkg) reinst_expand_map = None if reinstall_for_flags: reinst_flags_map = self.map_to_use_expand( list(reinstall_for_flags), remove_hidden=False) for k in list(reinst_flags_map): if not reinst_flags_map[k]: del reinst_flags_map[k] if not reinst_flags_map.get("USE"): reinst_expand_map = reinst_flags_map.copy() reinst_expand_map.pop("USE", None) if reinst_expand_map and \ not set(reinst_expand_map).difference( self.use_expand_hidden): self.use_expand_hidden = \ set(self.use_expand_hidden).difference( reinst_expand_map) cur_iuse_map, iuse_forced = \ self.map_to_use_expand(self.cur_iuse, forced_flags=True) cur_use_map = self.map_to_use_expand(self.cur_use) old_iuse_map = self.map_to_use_expand(self.old_iuse) old_use_map = self.map_to_use_expand(self.old_use) use_expand = sorted(self.use_expand) use_expand.insert(0, "USE") feature_flags = _get_feature_flags(_get_eapi_attrs(pkg.metadata["EAPI"])) for key in use_expand: if key in self.use_expand_hidden: continue self.verboseadd += _create_use_string(self.conf, key.upper(), cur_iuse_map[key], iuse_forced[key], cur_use_map[key], old_iuse_map[key], old_use_map[key], self.is_new, feature_flags, reinst_flags_map.get(key)) return
def recheck_hidden(self, pkg): """ Prevent USE_EXPAND_HIDDEN flags from being hidden if they are the only thing that triggered reinstallation. @param pkg: _emerge.Package.Package instance Modifies self.use_expand_hidden, self.use_expand, self.verboseadd """ reinst_flags_map = {} reinstall_for_flags = self.conf.reinstall_nodes.get(pkg) reinst_expand_map = None if reinstall_for_flags: reinst_flags_map = self.map_to_use_expand( list(reinstall_for_flags), remove_hidden=False) for k in list(reinst_flags_map): if not reinst_flags_map[k]: del reinst_flags_map[k] if not reinst_flags_map.get("USE"): reinst_expand_map = reinst_flags_map.copy() reinst_expand_map.pop("USE", None) if reinst_expand_map and \ not set(reinst_expand_map).difference( self.use_expand_hidden): self.use_expand_hidden = \ set(self.use_expand_hidden).difference( reinst_expand_map) cur_iuse_map, iuse_forced = \ self.map_to_use_expand(self.cur_iuse, forced_flags=True) cur_use_map = self.map_to_use_expand(self.cur_use) old_iuse_map = self.map_to_use_expand(self.old_iuse) old_use_map = self.map_to_use_expand(self.old_use) use_expand = sorted(self.use_expand) use_expand.insert(0, "USE") feature_flags = _get_feature_flags( _get_eapi_attrs(pkg.metadata["EAPI"])) for key in use_expand: if key in self.use_expand_hidden: continue self.verboseadd += _create_use_string( self.conf, key.upper(), cur_iuse_map[key], iuse_forced[key], cur_use_map[key], old_iuse_map[key], old_use_map[key], self.is_new, feature_flags, reinst_flags_map.get(key)) return
def _display_use(self, pkg, pkg_info): """ USE flag display @param pkg: _emerge.Package.Package instance @param pkg_info: PkgInfo instance Modifies self.use_expand_hidden, self.use_expand, self.verboseadd, self.forced_flags """ self.forced_flags = set() self.forced_flags.update(pkg.use.force) self.forced_flags.update(pkg.use.mask) cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \ if flag in pkg.iuse.all] cur_iuse = sorted(pkg.iuse.all) if pkg_info.previous_pkg is not None: previous_pkg = pkg_info.previous_pkg old_iuse = sorted(previous_pkg.iuse.all) old_use = previous_pkg.use.enabled is_new = False else: old_iuse = [] old_use = [] is_new = True old_use = [flag for flag in old_use if flag in old_iuse] self.use_expand = pkg.use.expand self.use_expand_hidden = pkg.use.expand_hidden # Prevent USE_EXPAND_HIDDEN flags from being hidden if they # are the only thing that triggered reinstallation. reinst_flags_map = {} reinstall_for_flags = self.conf.reinstall_nodes.get(pkg) reinst_expand_map = None if reinstall_for_flags: reinst_flags_map = self.map_to_use_expand( list(reinstall_for_flags), remove_hidden=False) for k in list(reinst_flags_map): if not reinst_flags_map[k]: del reinst_flags_map[k] if not reinst_flags_map.get("USE"): reinst_expand_map = reinst_flags_map.copy() reinst_expand_map.pop("USE", None) if reinst_expand_map and \ not set(reinst_expand_map).difference( self.use_expand_hidden): self.use_expand_hidden = \ set(self.use_expand_hidden).difference( reinst_expand_map) cur_iuse_map, iuse_forced = \ self.map_to_use_expand(cur_iuse, forced_flags=True) cur_use_map = self.map_to_use_expand(cur_use) old_iuse_map = self.map_to_use_expand(old_iuse) old_use_map = self.map_to_use_expand(old_use) use_expand = sorted(self.use_expand) use_expand.insert(0, "USE") feature_flags = _get_feature_flags(_get_eapi_attrs(pkg.eapi)) for key in use_expand: if key in self.use_expand_hidden: continue self.verboseadd += _create_use_string(self.conf, key.upper(), cur_iuse_map[key], iuse_forced[key], cur_use_map[key], old_iuse_map[key], old_use_map[key], is_new, feature_flags, reinst_flags_map.get(key)) return
def _display_use(self, pkg, pkg_info): """ USE flag display @param pkg: _emerge.Package.Package instance @param pkg_info: PkgInfo instance Modifies self.use_expand_hidden, self.use_expand, self.verboseadd, self.forced_flags """ self.forced_flags = set() self.forced_flags.update(pkg.use.force) self.forced_flags.update(pkg.use.mask) cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \ if flag in pkg.iuse.all] cur_iuse = sorted(pkg.iuse.all) if pkg_info.previous_pkg is not None: previous_pkg = pkg_info.previous_pkg old_iuse = sorted(previous_pkg.iuse.all) old_use = previous_pkg.use.enabled is_new = False else: old_iuse = [] old_use = [] is_new = True old_use = [flag for flag in old_use if flag in old_iuse] self.use_expand = pkg.use.expand self.use_expand_hidden = pkg.use.expand_hidden # Prevent USE_EXPAND_HIDDEN flags from being hidden if they # are the only thing that triggered reinstallation. reinst_flags_map = {} reinstall_for_flags = self.conf.reinstall_nodes.get(pkg) reinst_expand_map = None if reinstall_for_flags: reinst_flags_map = self.map_to_use_expand( list(reinstall_for_flags), remove_hidden=False) for k in list(reinst_flags_map): if not reinst_flags_map[k]: del reinst_flags_map[k] if not reinst_flags_map.get("USE"): reinst_expand_map = reinst_flags_map.copy() reinst_expand_map.pop("USE", None) if reinst_expand_map and \ not set(reinst_expand_map).difference( self.use_expand_hidden): self.use_expand_hidden = \ set(self.use_expand_hidden).difference( reinst_expand_map) cur_iuse_map, iuse_forced = \ self.map_to_use_expand(cur_iuse, forced_flags=True) cur_use_map = self.map_to_use_expand(cur_use) old_iuse_map = self.map_to_use_expand(old_iuse) old_use_map = self.map_to_use_expand(old_use) use_expand = sorted(self.use_expand) use_expand.insert(0, "USE") feature_flags = _get_feature_flags(_get_eapi_attrs(pkg.eapi)) for key in use_expand: if key in self.use_expand_hidden: continue self.verboseadd += _create_use_string( self.conf, key.upper(), cur_iuse_map[key], iuse_forced[key], cur_use_map[key], old_iuse_map[key], old_use_map[key], is_new, feature_flags, reinst_flags_map.get(key)) return