#
# $Header$
-"""'analyse' is a flexible utility for Gentoo linux which can display various
+"""'enalyze' is a flexible utility for Gentoo linux which can display various
information about installed packages, such as the USE flags used and the
packages that use them. It can also be used to help rebuild /etc/portage/package.*
files in the event of corruption, and possibly more.
print()
sys.exit(1)
-from gentoolkit import analyse, errors
+from gentoolkit import enalyze, errors
try:
- analyse.main()
+ enalyze.main()
except errors.GentoolkitException as err:
if '--debug' in sys.argv:
raise
-.TH "ANALYSE" "22" "Febuary 2010" "GENTOOLKIT" ""
+.TH "ENALYZE" "22" "Febuary 2010" "GENTOOLKIT" ""
.SH "NAME"
-analyse \- Gentoo Installed Package Analysis Tool
+enalyze \- Gentoo Installed Package Analysis Tool
.SH "SYNOPSIS"
-.BI "analyse " "[global\-options] " "module " "[local\-options]" "TARGET"
+.BI "enalyze " "[global\-options] " "module " "[local\-options]" "TARGET"
.SH "DESCRIPTION"
-.B Analyse
-Is a collection of modules for analysing the state of installed Gentoo packages for
+.B Enalyze
+Is a collection of modules for analyzing the state of installed Gentoo packages for
USE flags or keywords used for installation, and their current masking status.
.br
It can also optionally (re)generate new /etc/portage/package.* files.
.br
.B CAUTION:
-This is beta software and is not yet feature complete. Some features, options or its name
+This is beta software and is not yet feature complete. Some features, options
may change in the future. Any files that it generates are saved to your home directory
and will not harm your system without effort on your part.
.br
.B \-N, \-\-no\-pipe
.br
Turn off automatic pipe detection. Use this option if you do not want
-.B analyse
+.B enalyze
To detect if the output is being directed to the screen or to another program
and adjust color and verbosity accordingly.
.HP
below)
.SH "MODULES"
-.B Analyse
+.B Enalyze
Uses a system of modules. Each module has both a long and short name.
The list below uses the notation "\fBmodule (m)\fP", where \fIm\fP is the short name
and \fImodule\fP is the long name.
message for a specific module by using
.BR "\-h" ", " "\-\-help "
as either a global option (after
-.B analyse
+.B enalyze
and before the module name) or as a local option (after the module name).
.SS
-.BI "analyse (a) [OPTIONS] TARGET"
+.BI "analyze (a) [OPTIONS] TARGET"
Report on all installed packages for \fITARGET\fP.
.P
.HP
.B use
.br
-Will analyse the installed with USE flags for output results.
+Will analyze the installed with USE flags for output results.
.HP
.B pkguse
.br
-Will analyse the USE flags information from the installed pkg's 'PKGUSE' file which contains
+Will analyze the USE flags information from the installed pkg's 'PKGUSE' file which contains
only flags settings from /etc/portage/package.use at the time of installation.
.HP
.B keywords
.br
-Will analyse the recorded keywords for output results.
+Will analyze the recorded keywords for output results.
.HP
.B unmask
.br
-Will analyse the installed packages and portage trees for pkgs that require unmasking and report them.
+Will analyze the installed packages and portage trees for pkgs that require unmasking and report them.
.br
.P
.I R "LOCAL OPTIONS" ":"
.I R "EXAMPLES" ":"
.EX
.HP
-analyse a \-\-verbose \-\-unset use
+enalyze a \-\-verbose \-\-unset use
.EE
.br
Report on all use flags used to install the packages. (\-\-unset) Include in the report all flags
.HP
.B use
.br
-Will analyse the USE flags for output results.
+Will analyze the USE flags for output results.
.HP
.B keywords
.br
-Will analyse the keywords for output results.
+Will analyze the keywords for output results.
.HP
.B unmask
.br
-Will analyse the installed packages and portage trees for pkgs that require
+Will analyze the installed packages and portage trees for pkgs that require
unmasking and produce output/a new /etc/portage/package.unmask file.
.P
.I R "LOCAL OPTIONS" ":"
.I R "EXAMPLES" ":"
.EX
.HP
-analyse rebuild \-p use
+enalyze rebuild \-p use
.EE
.br
-Analyse the installed packages database and current system USE flag settings
+Analyze the installed packages database and current system USE flag settings
and output the results in the form of:
.br
.HP
.B use
.br
-Will analyse the USE flags and /etc/portage/package.use file(s) for entries that
+Will analyze the USE flags and /etc/portage/package.use file(s) for entries that
are redundant or no longer used by the pkg.
.HP
.B keywords
.br
-Will analyse the keywords and /etc/portage/package.keywords file(s) for entries
+Will analyze the keywords and /etc/portage/package.keywords file(s) for entries
that are no longer needed.
.HP
.B unmask
.br
-Will analyse the installed packages, /etc/portage/package.unmask file(s) and
+Will analyze the installed packages, /etc/portage/package.unmask file(s) and
portage trees for pkgs that no longer require unmasking.
.P
.I R "LOCAL OPTIONS" ":"
__docformat__ = 'epytext'
# version is dynamically set by distutils sdist
__version__ = "svn"
-__productname__ = "analyse"
+__productname__ = "enalyze"
__authors__ = (
'Brian Dolbec, <brian.dolbec@gmail.com>'
NAME_MAP = {
- 'a': 'analyse',
+ 'a': 'analyze',
'r': 'rebuild'
}
FORMATTED_OPTIONS = (
- (" (a)nalyse",
- "analyses the installed PKG database USE flag or keyword useage"),
+ (" (a)nalyze",
+ "analyzes the installed PKG database USE flag or keyword useage"),
(" (r)ebuild",
- "analyses the Installed PKG database and generates files suitable"),
+ "analyzes the Installed PKG database and generates files suitable"),
(" ",
"to replace corrupted or missing /etc/portage/package.* files")
)
import gentoolkit
from gentoolkit.dbapi import PORTDB, VARDB
-from gentoolkit.analyse.base import ModuleBase
+from gentoolkit.enalyze.base import ModuleBase
from gentoolkit import pprinter as pp
from gentoolkit.flag import get_installed_use, get_flags
-from gentoolkit.analyse.lib import FlagAnalyzer, KeywordAnalyser
-from gentoolkit.analyse.output import nl, AnalysisPrinter
+from gentoolkit.enalyze.lib import FlagAnalyzer, KeywordAnalyser
+from gentoolkit.enalyze.output import nl, AnalysisPrinter
from gentoolkit.package import Package
from gentoolkit.helpers import get_installed_cpvs
_get_flags=get_flags,
_get_used=get_installed_use
):
- """Analyse the installed pkgs USE flags for frequency of use
+ """Analyze the installed pkgs USE flags for frequency of use
@type cpvs: list
- @param cpvs: optional list of [cat/pkg-ver,...] to analyse or
+ @param cpvs: optional list of [cat/pkg-ver,...] to analyze or
defaults to entire installed pkg db
@type: system_flags: list
@param system_flags: the current default USE flags as defined
@type include_unset: bool
@param include_unset: controls the inclusion of unset USE flags in the report.
@type target: string
- @param target: the environment variable being analysed
+ @param target: the environment variable being analyzed
one of ["USE", "PKGUSE"]
@type _get_flags: function
@param _get_flags: ovride-able for testing,
- defaults to gentoolkit.analyse.lib.get_flags
+ defaults to gentoolkit.enalyze.lib.get_flags
@param _get_used: ovride-able for testing,
- defaults to gentoolkit.analyse.lib.get_installed_use
+ defaults to gentoolkit.enalyze.lib.get_installed_use
@rtype dict. {flag:{"+":[cat/pkg-ver,...], "-":[cat/pkg-ver,...], "unset":[]}
"""
if cpvs is None:
keywords=portage.settings["ACCEPT_KEYWORDS"],
analyser = None
):
- """Analyse the installed pkgs 'keywords' for frequency of use
+ """Analyze the installed pkgs 'keywords' for frequency of use
- @param cpvs: optional list of [cat/pkg-ver,...] to analyse or
+ @param cpvs: optional list of [cat/pkg-ver,...] to analyze or
defaults to entire installed pkg db
@param system_keywords: list of the system keywords
@param keywords: user defined list of keywords to check and report on
"""
def __init__(self):
ModuleBase.__init__(self)
- self.module_name = "analyse"
+ self.module_name = "enalyze"
self.options = {
"flags": False,
"keywords": False,
}
self.formatted_options = [
(" -h, --help", "Outputs this useage message"),
- (" -a, --analyse",
+ (" -a, --analyze",
"Action, sets the module to gather data and output the"),
("", "formatted stats/information to the screen"),
(" -u, --unset",
"Additionally include any unset USE flags and the packages"),
("", "that could use them"),
(" -v, --verbose",
- "Used in the analyse action to output more detailed information"),
+ "Used in the analyze action to output more detailed information"),
(" -p, --prefix",
"Used for testing purposes only, runs report using " +
"a prefix keyword and 'prefix' USE flag"),
]
self.formatted_args = [
(" use",
- "Causes the action to analyse the installed packages USE flags"),
+ "Causes the action to analyze the installed packages USE flags"),
(" pkguse",
- "Causes the action to analyse the installed packages PKGUSE flags"),
+ "Causes the action to analyze the installed packages PKGUSE flags"),
(" ",
"These are flags that have been set in /etc/portage/package.use"),
(" keywords",
- "Causes the action to analyse the installed packages keywords"),
+ "Causes the action to analyze the installed packages keywords"),
(" packages",
- "Causes the action to analyse the installed packages and the"),
+ "Causes the action to analyze the installed packages and the"),
(" ",
"USE flags they were installed with"),
]
self.analyse_packages()
def analyse_flags(self, target):
- """This will scan the installed packages db and analyse the
+ """This will scan the installed packages db and analyze the
USE flags used for installation and produce a report on how
they were used.
@type target: string
- @param target: the target to be analysed, one of ["use", "pkguse"]
+ @param target: the target to be analyzed, one of ["use", "pkguse"]
"""
system_use = portage.settings["USE"].split()
self.printer = AnalysisPrinter(
def analyse_keywords(self, keywords=None):
- """This will scan the installed packages db and analyse the
+ """This will scan the installed packages db and analyze the
keywords used for installation and produce a report on them.
"""
print()
def analyse_packages(self):
- """This will scan the installed packages db and analyse the
+ """This will scan the installed packages db and analyze the
USE flags used for installation and produce a report.
@type target: string
- @param target: the target to be analysed, one of ["use", "pkguse"]
+ @param target: the target to be analyzed, one of ["use", "pkguse"]
"""
system_use = portage.settings["USE"].split()
if self.options["verbose"]:
def main(input_args):
- """Common starting method by the analyse master
+ """Common starting method by the analyze master
unless all modules are converted to this class method.
@param input_args: input args as supplied by equery master module.
#
# $Header: $
-"""Analyse Base Module class to hold common module operation functions
+"""Enalyze Base Module class to hold common module operation functions
"""
from __future__ import print_function
from gentoolkit import CONFIG
class ModuleBase(object):
- """Analyse base module class to parse module options print module help, etc.."""
+ """Enalyze base module class to parse module options print module help, etc.."""
def __init__(self):
self.module_name = None
#
-"""Provides support functions to analyse modules"""
+"""Provides support functions to enalyze modules"""
import sys
return self._analyse(installed, iuse)
def _analyse(self, installed, iuse):
- """Analyses the supplied info and returns the flag settings
+ """Analyzes the supplied info and returns the flag settings
that differ from the defaults
@type installed: set
h=("# This package.%s file was generated by "
%self.target +
- "gentoolkit's 'analyse rebuild' module\n"
+ "gentoolkit's 'enalyze rebuild' module\n"
"# Date: " + time.asctime() + "\n"
)
return h
import gentoolkit
from gentoolkit.dbapi import PORTDB, VARDB
-from gentoolkit.analyse.base import ModuleBase
+from gentoolkit.enalyze.base import ModuleBase
from gentoolkit import pprinter as pp
-from gentoolkit.analyse.lib import (get_installed_use, get_flags, FlagAnalyzer,
+from gentoolkit.enalyze.lib import (get_installed_use, get_flags, FlagAnalyzer,
KeywordAnalyser)
from gentoolkit.flag import reduce_flags
-from gentoolkit.analyse.output import RebuildPrinter
+from gentoolkit.enalyze.output import RebuildPrinter
from gentoolkit.atom import Atom
and the currently installed pkgs recorded USE flag settings
@type cpvs: list
- @param cpvs: optional list of [cat/pkg-ver,...] to analyse or
+ @param cpvs: optional list of [cat/pkg-ver,...] to analyze or
defaults to entire installed pkg db
@type: system_flags: list
@param system_flags: the current default USE flags as defined
by portage.settings["USE"].split()
@type _get_flags: function
@param _get_flags: ovride-able for testing,
- defaults to gentoolkit.analyse.lib.get_flags
+ defaults to gentoolkit.enalyze.lib.get_flags
@param _get_used: ovride-able for testing,
- defaults to gentoolkit.analyse.lib.get_installed_use
+ defaults to gentoolkit.enalyze.lib.get_installed_use
@rtype dict. {cpv:['flag1', '-flag2',...]}
"""
if cpvs is None:
keywords=portage.settings["ACCEPT_KEYWORDS"],
analyser = None
):
- """Analyse the installed pkgs 'keywords' for difference from ACCEPT_KEYWORDS
+ """Analyze the installed pkgs 'keywords' for difference from ACCEPT_KEYWORDS
- @param cpvs: optional list of [cat/pkg-ver,...] to analyse or
+ @param cpvs: optional list of [cat/pkg-ver,...] to analyze or
defaults to entire installed pkg db
@param system_keywords: list of the system keywords
@param keywords: user defined list of keywords to check and report on
]
self.formatted_args = [
(" use",
- "causes the action to analyse the installed packages USE flags"),
+ "causes the action to analyze the installed packages USE flags"),
(" keywords",
- "causes the action to analyse the installed packages keywords"),
+ "causes the action to analyze the installed packages keywords"),
(" unmask",
- "causes the action to analyse the installed packages " + \
+ "causes the action to analyze the installed packages " + \
"current mask status")
]
self.short_opts = "hepsv"
def rebuild_keywords(self):
print("Module action not yet available")
print()
- """This will scan the installed packages db and analyse the
+ """This will scan the installed packages db and analyze the
keywords used for installation and produce a report on them.
"""
system_keywords = portage.settings["ACCEPT_KEYWORDS"].split()
def main(input_args):
- """Common starting method by the analyse master
+ """Common starting method by the analyze master
unless all modules are converted to this class method.
@param input_args: input args as supplied by equery master module.