[packagedb-cli] Extend the fix of name_only
by Pierre-YvesChibon
commit e30b20e74646336936c0491411fa3b98656d34e7
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Nov 14 09:38:38 2011 +0100
Extend the fix of name_only
Won't print Total X packages for list --user command and orphan action
pkgdb-cli.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/pkgdb-cli.py b/pkgdb-cli.py
index 59a2905..c3e5afa 100755
--- a/pkgdb-cli.py
+++ b/pkgdb-cli.py
@@ -490,7 +490,8 @@ def get_orphaned_packages(motif=None, eol=False, name_only=False,
if branch == 'all' or branch in branches:
print out, "[" + "],[".join(branches) + "]"
cnt = cnt + 1
- print 'Total: {0} packages'.format(cnt)
+ if not name_only:
+ print 'Total: {0} packages'.format(cnt)
def get_packager_info(packager, motif="", output=True, name_only=False,
@@ -551,7 +552,7 @@ def get_packager_info(packager, motif="", output=True, name_only=False,
if branch == 'all' or branch in branches:
print out
cnt = cnt + 1
- if output:
+ if output and not name_only:
print "Total: {0} packages".format(cnt)
return pkgs
12 years, 5 months
[packagedb-cli] Fix the list --nameonly
by Pierre-YvesChibon
commit 1d67ad6aac6f5ca7a49355a7caf2321db0142657
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu Nov 3 09:22:50 2011 +0100
Fix the list --nameonly
pkgdb-cli.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/pkgdb-cli.py b/pkgdb-cli.py
index 0c8262a..59a2905 100755
--- a/pkgdb-cli.py
+++ b/pkgdb-cli.py
@@ -411,14 +411,15 @@ def get_packages(motif=None, name_only=False, branch='all'):
log.debug("collection map: {0}".format(collectn_map))
log.debug("status map: {0}".format(status_map))
- print pkgdbinfo['title']
+ if not name_only:
+ print pkgdbinfo['title']
cnt = 0
for pkg in pkgdbinfo['packages']:
out = " " + pkg['name'] + ' ' * (33 - \
len(pkg['name'])) + \
pkg['summary']
if name_only:
- out = " ", pkg['name']
+ out = " "+ pkg['name']
branches = []
for info in pkg['listings']:
@@ -430,7 +431,8 @@ def get_packages(motif=None, name_only=False, branch='all'):
if branch == 'all' or branch in branches:
print out
cnt = cnt + 1
- print 'Total: {0} packages'.format(cnt)
+ if not name_only:
+ print 'Total: {0} packages'.format(cnt)
def get_orphaned_packages(motif=None, eol=False, name_only=False,
12 years, 6 months