diff --git a/client/equo.py b/client/equo.py index b85c05487..664117631 100644 --- a/client/equo.py +++ b/client/equo.py @@ -207,7 +207,7 @@ help_opts = [ (2, 'installed', 1, _('search a package into the local database')), (2, 'license', 2, _('show packages owning the provided licenses')), (2, 'list', 2, _('list packages based on the chosen parameter below')), - (3, 'installed', 2, _('list installed packages')), + (3, 'installed [repo]', 2, _('list installed packages')), (4, '--by-user', 2, _('only packages installed by user')), (3, 'available [repos]', 1, _('list available packages')), (2, 'mimetype', 1, _('search packages able to handle given mimetypes')), diff --git a/client/text_query.py b/client/text_query.py index a0ef12b68..f3a59a347 100644 --- a/client/text_query.py +++ b/client/text_query.py @@ -173,7 +173,12 @@ def query(options): elif cmd == "list": mylistopts = options[1:] if len(mylistopts) > 0: - if mylistopts[0] == "installed": + lopt, instopts = mylistopts[0], mylistopts[1:] + + if lopt == "installed": + repoid = None + if instopts: + repoid = instopts[0] def by_user_filter(pkg_match): pkg_id, pkg_repo = pkg_match @@ -182,16 +187,25 @@ def query(options): pkg_id) return source_id == etpConst['install_sources']['user'] + def by_repoid_filter(pkg_match): + pkg_id, pkg_repo = pkg_match + repo_db = etp_client.open_repository(pkg_repo) + inst_pkg_repo = repo_db.getInstalledPackageRepository( + pkg_id) + return inst_pkg_repo == repoid + filter_func = None - if "--by-user" in mylistopts: + if "--by-user" == repoid: filter_func = by_user_filter + elif repoid: + filter_func = by_repoid_filter rc_status = list_packages(etp_client, etp_client.installed_repository(), filter_func = filter_func) - elif mylistopts[0] == "available" and len(mylistopts) > 1: - repoid = mylistopts[1] + elif lopt == "available" and len(instopts) > 0: + repoid = instopts[0] if repoid in etp_client.repositories(): repo_dbconn = etp_client.open_repository(repoid) rc_status = list_packages(etp_client, repo_dbconn) diff --git a/docs/man/equo.pod b/docs/man/equo.pod index 13b9fecd2..4d9391a5c 100644 --- a/docs/man/equo.pod +++ b/docs/man/equo.pod @@ -678,7 +678,7 @@ list packages based on the chosen parameter below =over -=item [3] B +=item [3] B [repo] list installed packages diff --git a/docs/man/man1/equo.1 b/docs/man/man1/equo.1 index ed3112510..5e11b4754 100644 --- a/docs/man/man1/equo.1 +++ b/docs/man/man1/equo.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EQUO 1" -.TH EQUO 1 "2012-05-09" "perl v5.12.4" "Entropy" +.TH EQUO 1 "2012-05-14" "perl v5.12.4" "Entropy" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -625,8 +625,8 @@ show packages owning the provided licenses .IX Item "[2] list" list packages based on the chosen parameter below .RS 4 -.IP "[3] \fBinstalled\fR" 4 -.IX Item "[3] installed" +.IP "[3] \fBinstalled\fR [repo]" 4 +.IX Item "[3] installed [repo]" list installed packages .RS 4 .IP "[4] \fB\-\-by\-user\fR" 4