From: Michael Tremer Date: Fri, 17 Sep 2010 19:44:56 +0000 (+0200) Subject: naoki: Also create raw output for binary packages. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=170cefb5e1a50cd4f4c99a0bf45bb4c82eceb842;p=ipfire-3.x.git naoki: Also create raw output for binary packages. --- diff --git a/naoki/__init__.py b/naoki/__init__.py index 14a5665ca..87773dcca 100644 --- a/naoki/__init__.py +++ b/naoki/__init__.py @@ -12,6 +12,7 @@ import build import environ import generators import logger +import packages import repositories import terminal import util @@ -159,11 +160,16 @@ Release : %(PKG_REL)s pass def call_package_raw(self, args): - repo = self._get_source_repos() + filename = args.package - p = repo.find_package_by_name(args.package) - if not p: - raise Exception, "Could not find package: %s" % args.package + if os.path.exists(filename): + p = packages.BinaryPackage(filename) + else: + repo = self._get_source_repos() + + p = repo.find_package_by_name(args.package) + if not p: + raise Exception, "Could not find package: %s" % args.package p.print_raw_info() diff --git a/naoki/packages.py b/naoki/packages.py index a7cb77d4b..467f09840 100644 --- a/naoki/packages.py +++ b/naoki/packages.py @@ -67,6 +67,13 @@ class Package(object): def version(self): return self._info["PKG_VER"] + def print_raw_info(self): + for k in sorted(self._info.keys()): + print "%s=\"%s\"" % (k, self._info.get(k)) + + def fmtstr(self, s): + return s % self._info + class SourcePackage(Package): def __init__(self, filename, repo, arch): @@ -156,13 +163,6 @@ class SourcePackage(Package): g.urlgrab(os.path.basename(file), filename=file) - def print_raw_info(self): - 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):