print(" cat/pkg-ver USE Flags")
blankline = lambda: None
for cpv in cpvs:
- (flag_plus, flag_neg, cleaned) = flags.analyse_cpv(cpv)
+ (flag_plus, flag_neg, unset) = flags.analyse_cpv(cpv)
if self.options["unset"]:
- self.printer(cpv, "", (flag_plus, flag_neg, cleaned))
+ self.printer(cpv, "", (flag_plus, flag_neg, unset))
else:
- self.printer(cpv, "", (flag_plus, [], cleaned))
+ self.printer(cpv, "", (flag_plus, flag_neg, []))
if not self.options['quiet']:
print("===================================================")
print("Total number of installed ebuilds =",
plus = usedflags
minus = defaults.difference(usedflags)
unset = iuse.difference(defaults, plus, minus)
- cleaned = self.remove_expanding(unset)
- return (plus, minus, cleaned)
+ cleaned_unset = self.remove_expanding(unset)
+ return (plus, minus, cleaned_unset)
def analyse_pkg(self, pkg):
"""Gets all relevent USE flag info for a pkg and breaks them down
@return (plus, minus, unset) sets of USE flags
"""
installed = set(self.pkg_used(pkg))
+ print("installed =", installed)
iuse = set(reduce_flags(self.pkg_flags(pkg)))
+ print("iuse =", iuse)
return self._analyse(installed, iuse)
def pkg_used(self, pkg):
(plus, minus, cleaned) = flags
_plus = []
_minus = []
+ _cleaned = []
for flag in plus:
_flag = flag.strip()
if _flag:
_flag = flag.strip()
if _flag:
_minus.append(_flag)
+ for flag in cleaned:
+ _flag = flag.strip()
+ if _flag:
+ _cleaned.append(_flag)
#print("cpv=", key, "_plus=", _plus, "_minus=", _minus)
self.print_fn(key, (plus, minus, cleaned))
def print_pkg_verbose(self, cpv, flags):
"""Verbosely prints the pkg's use flag info.
"""
- (plus, minus, cleaned) = flags
+ (plus, minus, unset) = flags
_flags = []
for flag in plus:
_flags.append(pp.useflag((flag), True))
for flag in minus:
- _flags.append(pp.useflag(('-'+flag), False))
-
+ _flags.append(pp.useflag(('-' + flag), False))
+ for flag in unset:
+ _flags.append(pp.globaloption('-' + flag))
+
print(self._format_values(cpv, ", ".join(_flags)))
+
def print_pkg_quiet(self, cpv, flags):
"""Verbosely prints the pkg's use flag info.
"""
- (plus, minus, cleaned) = flags
+ (plus, minus, unset) = flags
_flags = []
for flag in plus:
_flags.append(pp.useflag((flag), True))
for flag in minus:
_flags.append(pp.useflag(('-'+flag), False))
+ for flag in unset:
+ _flags.append(pp.globaloption('-' + flag))
print(self._format_values(cpv, ", ".join(_flags)))