[equo] add support for "equo match --installed"

This commit is contained in:
Fabio Erculiani
2010-04-16 12:08:20 +02:00
parent 7f1516382e
commit 87f1531876
6 changed files with 143 additions and 102 deletions

View File

@@ -75,6 +75,7 @@ help_opts = [
(1, 'search', 2, _('search packages in repositories'), ),
(1, 'match', 2, _('match a package in repositories')),
(2, '--multimatch', 1, _('return all the possible matches')),
(2, '--installed', 1, _('match inside installed packages repository')),
(2, '--multirepo', 1, _('return matches from every repository')),
(2, '--showrepo', 1, _('print repository information (w/--quiet)')),
(2, '--showdesc', 1, _('print description too (w/--quiet)')),

View File

@@ -36,6 +36,7 @@ def query(options):
show_repo = False
show_desc = False
complete_graph = False
match_installed = False
myopts = []
first_opt = None
@@ -54,6 +55,8 @@ def query(options):
multi_match = True
elif (opt == "--multirepo") and (first_opt == "match"):
multi_repo = True
elif (opt == "--installed") and (first_opt == "match"):
match_installed = True
elif (opt == "--showrepo") and (first_opt == "match"):
show_repo = True
elif (opt == "--showdesc") and (first_opt == "match"):
@@ -74,7 +77,8 @@ def query(options):
multiMatch = multi_match,
multiRepo = multi_repo,
showRepo = show_repo,
showDesc = show_desc)
showDesc = show_desc,
installed = match_installed)
elif myopts[0] == "search":
rc_status = search_package(myopts[1:])
@@ -1188,7 +1192,8 @@ def search_package(packages, Equo = None, get_results = False,
return 0
def match_package(packages, multiMatch = False, multiRepo = False,
showRepo = False, showDesc = False, Equo = None, get_results = False):
showRepo = False, showDesc = False, Equo = None, get_results = False,
installed = False):
if Equo is None:
Equo = EquoInterface()
@@ -1204,8 +1209,16 @@ def match_package(packages, multiMatch = False, multiRepo = False,
if not etpUi['quiet'] and not get_results:
print_info("%s: %s" % (blue(" # "), bold(package),))
match = Equo.atom_match(package, multi_match = multiMatch,
multi_repo = multiRepo, mask_filter = False)
if installed:
inst_pkg_id, inst_rc = Equo.installed_repository().atomMatch(
package, multiMatch = multiMatch)
if inst_rc != 0:
match = (-1, 1)
else:
match = (inst_pkg_id, etpConst['clientdbid'])
else:
match = Equo.atom_match(package, multi_match = multiMatch,
multi_repo = multiRepo, mask_filter = False)
if match[1] != 1:
if not multiMatch:

View File

@@ -102,6 +102,10 @@ match a package in repositories
return all the possible matches
=item B<--installed>
match inside installed packages repository
=item B<--multirepo>
return matches from every repository

View File

@@ -1,15 +1,7 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37
.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
@@ -25,11 +17,11 @@
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
@@ -48,22 +40,25 @@
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
@@ -129,9 +124,13 @@
.\" ========================================================================
.\"
.IX Title "ACTIVATOR 1"
.TH ACTIVATOR 1 "2010-03-29" "perl v5.8.8" "Entropy"
.TH ACTIVATOR 1 "2010-03-29" "perl v5.10.1" "Entropy"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
\&\fBactivator\fR \- Official Sabayon Linux Server\-Side Repositories Management tool.
\&\fBactivator\fR \- Official Sabayon Linux Server-Side Repositories Management tool.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fBactivator\fR [action] [basic_options] [options] [atom | package_file | \f(CW@set\fR] ...
@@ -212,16 +211,16 @@ repository handling functions
sync the current repository database across primary mirrors
.IP "\fBlock\fR" 4
.IX Item "lock"
lock the current repository database (server\-side)
lock the current repository database (server-side)
.IP "\fBunlock\fR" 4
.IX Item "unlock"
unlock the current repository database (server\-side)
unlock the current repository database (server-side)
.IP "\fBdownload-lock\fR" 4
.IX Item "download-lock"
lock the current repository database (client\-side)
lock the current repository database (client-side)
.IP "\fBdownload-unlock\fR" 4
.IX Item "download-unlock"
unlock the current repository database (client\-side)
unlock the current repository database (client-side)
.IP "\fBlock-status\fR" 4
.IX Item "lock-status"
show current lock status
@@ -246,10 +245,11 @@ remove a news item from the notice board
read the current notice board
.RE
.RS 4
.RE
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
\&\fB\s-1ETP_REPO\s0\fR=valid repository id: on-the-fly switch default Entropy repository.
.Sp
.PP
\&\fB\s-1ETP_EXPIRATION_DAYS\s0\fR=valid number: on-the-fly removed packages expiration days
setting.
.SH "BUGS"
@@ -264,4 +264,10 @@ is returned in case of failure.
Fabio Erculiani <lxnay@sabayon.org>
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIreagent\fR\|(1), \fIequo\fR\|(1)
\&\fIreagent\fR\|(1), \fIequo\fR\|(1)
.SH "POD ERRORS"
.IX Header "POD ERRORS"
Hey! \fBThe above document had some coding errors, which are explained below:\fR
.IP "Around line 164:" 4
.IX Item "Around line 164:"
You forgot a '=back' before '=head1'

View File

@@ -1,15 +1,7 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37
.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
@@ -25,11 +17,11 @@
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
@@ -48,22 +40,25 @@
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
@@ -129,7 +124,11 @@
.\" ========================================================================
.\"
.IX Title "EQUO 1"
.TH EQUO 1 "2010-03-01" "perl v5.8.8" "Entropy"
.TH EQUO 1 "2010-04-16" "perl v5.10.1" "Entropy"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
\&\fBequo\fR \- Official Sabayon Linux Package Manager Client
.SH "SYNOPSIS"
@@ -147,7 +146,7 @@
.IX Header "DESCRIPTION"
\&\fBequo\fR is the definitive (rofl)... scratch it.
\&\fBequo\fR is the official command-line interface to the Entropy framework. Primarily
used to ease packages management on Gentoo\-based, Entropy-enabled distributions.
used to ease packages management on Gentoo-based, Entropy-enabled distributions.
.PP
With \fBequo\fR you can easily install and remove any application inside available and
enabled repositories: it's a binary package manager which brings the best from
@@ -210,6 +209,9 @@ match a package in repositories
.IP "\fB\-\-multimatch\fR" 4
.IX Item "--multimatch"
return all the possible matches
.IP "\fB\-\-installed\fR" 4
.IX Item "--installed"
match inside installed packages repository
.IP "\fB\-\-multirepo\fR" 4
.IX Item "--multirepo"
return matches from every repository
@@ -799,16 +801,16 @@ sync all the configured repositories
.RE
.IP "\fBdb-lock\fR" 4
.IX Item "db-lock"
lock the current repository database (server\-side)
lock the current repository database (server-side)
.IP "\fBdb-unlock\fR" 4
.IX Item "db-unlock"
unlock the current repository database (server\-side)
unlock the current repository database (server-side)
.IP "\fBdb-download-lock\fR" 4
.IX Item "db-download-lock"
lock the current repository database (client\-side)
lock the current repository database (client-side)
.IP "\fBdb-download-unlock\fR" 4
.IX Item "db-download-unlock"
unlock the current repository database (client\-side)
unlock the current repository database (client-side)
.IP "\fBdb-lock-status\fR" 4
.IX Item "db-lock-status"
show current lock status
@@ -915,7 +917,7 @@ delete keypair (and digital signatures) of repository
show currently configured keys information for given repositories
.IP "\fBsign [repos]\fR" 4
.IX Item "sign [repos]"
sign (or re\-sign) packages in repository using currently set keypair
sign (or re-sign) packages in repository using currently set keypair
.IP "\fBimport <repo_id\fR <privkey_path> <pubkey_path>>" 4
.IX Item "import <repo_id <privkey_path> <pubkey_path>>"
import keypair, bind to given repository
@@ -1123,14 +1125,14 @@ show system information
.IX Header "ENVIRONMENT"
\&\fB\s-1ETP_NOCACHE\s0\fR=1: if set, all the Entropy framework will never use its internal
on-disk cache.
.Sp
.PP
\&\fB\s-1FORCE_EAPI\s0\fR=N: if set to 1, 2 or 3 and used with '\fBequo\fR update', Entropy
repository synchronized will be force to use the provided \s-1EAPI\s0 to update
repositories.
.Sp
.PP
\&\fB\s-1ACCEPT_LICENSE\s0\fR=license_id1:license_id2:...: this is a way to avoid equo
asking to accept specific licenses.
.Sp
.PP
\&\fB\s-1ETP_NO_COLOR\s0\fR=1: disable entropy coloured output.
.SH "BUGS"
.IX Header "BUGS"
@@ -1154,4 +1156,10 @@ returned in case of failure.
Fabio Erculiani <lxnay@sabayon.org>
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIreagent\fR\|(1), \fIactivator\fR\|(1)
\&\fIreagent\fR\|(1), \fIactivator\fR\|(1)
.SH "POD ERRORS"
.IX Header "POD ERRORS"
Hey! \fBThe above document had some coding errors, which are explained below:\fR
.IP "Around line 1320:" 4
.IX Item "Around line 1320:"
You forgot a '=back' before '=head1'

View File

@@ -1,15 +1,7 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37
.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
@@ -25,11 +17,11 @@
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
@@ -48,22 +40,25 @@
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
@@ -129,9 +124,13 @@
.\" ========================================================================
.\"
.IX Title "REAGENT 1"
.TH REAGENT 1 "2010-03-30" "perl v5.8.8" "Entropy"
.TH REAGENT 1 "2010-03-30" "perl v5.10.1" "Entropy"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
\&\fBreagent\fR \- Official Sabayon Linux Server\-Side Package Management tool
\&\fBreagent\fR \- Official Sabayon Linux Server-Side Package Management tool
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fBreagent\fR [action] [basic_options] [options] [atom | package_file | \f(CW@set\fR] ...
@@ -340,7 +339,7 @@ delete keypair (and digital signatures) of repository
show currently configured keys information for given repositories
.IP "\fBsign [repos]\fR" 4
.IX Item "sign [repos]"
sign (or re\-sign) packages in repository using currently set keypair
sign (or re-sign) packages in repository using currently set keypair
.IP "\fBimport <repo_id\fR <privkey_path> <pubkey_path>>" 4
.IX Item "import <repo_id <privkey_path> <pubkey_path>>"
import keypair, bind to given repository
@@ -353,10 +352,10 @@ export public key of given repository
.IP "\fBexport-private <repo_id\fR <key_path>>" 4
.IX Item "export-private <repo_id <key_path>>"
export private key of given repository
.RE
.IP "\fBspm\fR"
.IP "\fBspm\fR" 4
.IX Item "spm"
source package manager functions
.RS 4
.IP "\fBcompile\fR" 4
.IX Item "compile"
compilation function
@@ -400,30 +399,31 @@ scan orphaned packages in \s-1SPM\s0
.IX Item "new [categories]"
scan new packages available in \s-1SPM\s0
.RE
.IP "\fBdeptest\fR"
.RS 4
.RE
.IP "\fBdeptest\fR" 4
.IX Item "deptest"
look for unsatisfied dependencies
.RE
.IP "\fBlibtest\fR"
.IP "\fBlibtest\fR" 4
.IX Item "libtest"
look for missing libraries
.RS 4
.IP "\fB\-\-dump\fR" 4
.IX Item "--dump"
dump results to files
.RE
.IP "\fBpkgtest\fR"
.RS 4
.RE
.IP "\fBpkgtest\fR" 4
.IX Item "pkgtest"
verify the integrity of local package files
.RE
.IP "\fBrevdeps\fR"
.IP "\fBrevdeps\fR" 4
.IX Item "revdeps"
regenerate reverse dependencies metadata
.RE
.IP "\fBlibpaths\fR"
.IP "\fBlibpaths\fR" 4
.IX Item "libpaths"
regenerate the library paths table
.RE
.IP "\fBcleanup\fR"
.IP "\fBcleanup\fR" 4
.IX Item "cleanup"
remove downloaded packages and clean temp. directories)
.SH "ENVIRONMENT"
@@ -441,4 +441,13 @@ is returned in case of failure.
Fabio Erculiani <lxnay@sabayon.org>
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIactivator\fR\|(1), \fIequo\fR\|(1)
\&\fIactivator\fR\|(1), \fIequo\fR\|(1)
.SH "POD ERRORS"
.IX Header "POD ERRORS"
Hey! \fBThe above document had some coding errors, which are explained below:\fR
.IP "Around line 304:" 4
.IX Item "Around line 304:"
\&'=item' outside of any '=over'
.IP "Around line 404:" 4
.IX Item "Around line 404:"
You forgot a '=back' before '=head1'