From: Michael Tremer Date: Wed, 15 Sep 2010 22:43:19 +0000 (+0200) Subject: naoki: Fix output of package information in human readable format. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f99bb9aa1052ee5cecd501e211d89915d7e4e90;p=ipfire-3.x.git naoki: Fix output of package information in human readable format. --- diff --git a/naoki/__init__.py b/naoki/__init__.py index 45d509c1d..14a5665ca 100644 --- a/naoki/__init__.py +++ b/naoki/__init__.py @@ -101,33 +101,36 @@ class Naoki(object): repo = self._get_source_repos() for package in repo.packages: + if args.packages: + if not package.name in args.packages: + continue + if args.long: print package.fmtstr("""\ -------------------------------------------------------------------------------- -Name : %(name)s -Version : %(version)s -Release : %(release)s +Name : %(PKG_NAME)s +Version : %(PKG_VER)s +Release : %(PKG_REL)s - %(summary)s + %(PKG_SUMMARY)s -%(description)s +%(PKG_DESCRIPTION)s -Maintainer : %(maintainer)s -License : %(license)s +Maintainer : %(PKG_MAINTAINER)s +License : %(PKG_LICENSE)s -Files : %(files)s -Objects : %(objects)s -Patches : %(patches)s +Objects : %(PKG_OBJECTS)s +Patches : %(PKG_PATCHES)s --------------------------------------------------------------------------------\ """) else: print package.fmtstr("""\ -------------------------------------------------------------------------------- -Name : %(name)s -Version : %(version)s -Release : %(release)s +Name : %(PKG_NAME)s +Version : %(PKG_VER)s +Release : %(PKG_REL)s - %(summary)s + %(PKG_SUMMARY)s --------------------------------------------------------------------------------\ """) @@ -145,7 +148,7 @@ Release : %(release)s continue if args.long: - print package.fmtstr("%(name)-32s | %(version)-15s | %(summary)s") + print package.fmtstr("%(PKG_NAME)-32s | %(PKG_VER)-15s | %(PKG_SUMMARY)s") else: print package.name diff --git a/naoki/packages.py b/naoki/packages.py index 782337e40..a7cb77d4b 100644 --- a/naoki/packages.py +++ b/naoki/packages.py @@ -160,6 +160,9 @@ class SourcePackage(Package): for k, v in self._info.items(): print "%s=\"%s\"" % (k, v) + def fmtstr(self, s): + return s % self._info + class BinaryPackage(Package): def __init__(self, filename):