From 1b3ce99de8f2fd6113455e2ffb664aa6dc628d46 Mon Sep 17 00:00:00 2001 From: genone Date: Tue, 26 Apr 2005 00:38:06 +0000 Subject: [PATCH] more sticky tape to get this thing released svn path=/; revision=208 --- trunk/ChangeLog | 5 +++++ trunk/src/equery/equery | 4 ++-- trunk/src/gentoolkit/Makefile | 6 +++--- trunk/src/gentoolkit/helpers.py | 12 ++++++++---- trunk/src/gentoolkit/package.py | 3 +++ 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index efb7a46..f067f5e 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,8 @@ +2005-04-26 Marius Mauch + * gentoolkit: fix broken Makefile + * gentoolkit: add some sticky tape to get the stupid thing working again + * equery: fix a few minor problems + 2005-04-25 Marius Mauch * qpkg: moving to /usr/share/doc/gentoolkit-*/deprecated * etcat: moving to /usr/share/doc/gentoolkit-*/deprecated diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 079c15b..102e508 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -732,7 +732,7 @@ class CmdDisplaySize(Command): sz = "%.2f KiB" % (size/1024.0) if opts["reportSizeInBytes"]: - sz = number(str(size)) + " bytes" + sz = pp.number(str(size)) + " bytes" print_info(0, string.rjust("Total size : ",25) + pp.number(sz)) @@ -917,7 +917,7 @@ class CmdWhich(Command): return "Print full path to ebuild for a given package" + \ "\n" + \ "Syntax:\n" + \ - " " + pp.command("size ") + pp.pkgquery("pkgspec") + " " + pp.command("which ") + pp.pkgquery("pkgspec") class CmdListGLSAs(Command): """List outstanding GLSAs.""" diff --git a/trunk/src/gentoolkit/Makefile b/trunk/src/gentoolkit/Makefile index 84981a2..4fb319b 100644 --- a/trunk/src/gentoolkit/Makefile +++ b/trunk/src/gentoolkit/Makefile @@ -11,12 +11,12 @@ all: dist: mkdir -p ../../${distdir}/src/gentoolkit - cp Makefile AUTHORS README ChangeLog TODO package.py helpers.py pprinter.py __init__.py ../../${distdir}/src/gentoolkit/ + cp Makefile AUTHORS README ChangeLog TODO errors.py package.py helpers.py pprinter.py __init__.py ../../${distdir}/src/gentoolkit/ install: install -d $(docdir)/gentoolkit - install -m 0644 AUTHORS README TODO ChangeLog $(docdir)/gentoolkit/ + install -m 0644 AUTHORS README TODO $(docdir)/gentoolkit/ install -d $(DESTDIR)/usr/lib/gentoolkit/pym/gentoolkit - install -m 0644 package.py pprinter.py package.py $(DESTDIR)/usr/lib/gentoolkit/pym/gentoolkit/ + install -m 0644 package.py pprinter.py helpers.py errors.py $(DESTDIR)/usr/lib/gentoolkit/pym/gentoolkit/ install -m 0644 __init__.py $(DESTDIR)/usr/lib/gentoolkit/pym/gentoolkit/ diff --git a/trunk/src/gentoolkit/helpers.py b/trunk/src/gentoolkit/helpers.py index 94c3533..98c9b37 100644 --- a/trunk/src/gentoolkit/helpers.py +++ b/trunk/src/gentoolkit/helpers.py @@ -7,6 +7,10 @@ # # $Header$ +import portage +from gentoolkit import * +from gentoolkit.package import * + def find_packages(search_key, masked=False): """Returns a list of Package objects that matched the search key.""" try: @@ -30,13 +34,13 @@ def find_packages(search_key, masked=False): def find_installed_packages(search_key, masked=False): """Returns a list of Package objects that matched the search key.""" try: - t = vartree.dbapi.match(search_key) + t = portage.db["/"]["vartree"].dbapi.match(search_key) # catch the "amgigous package" Exception except ValueError, e: if type(e[0]) == types.ListType: t = [] for cp in e[0]: - t += vartree.dbapi.match(cp) + t += portage.db["/"]["vartree"].dbapi.match(cp) else: raise ValueError(e) return [Package(x) for x in t] @@ -47,9 +51,9 @@ def find_best_match(search_key): # FIXME: How should we handled versioned virtuals?? cat,pkg,ver,rev = split_package_name(search_key) if cat == "virtual": - t = vartree.dep_bestmatch(cat+"/"+pkg) + t = portage.db["/"]["vartree"].dep_bestmatch(cat+"/"+pkg) else: - t = vartree.dep_bestmatch(search_key) + t = portage.db["/"]["vartree"].dep_bestmatch(search_key) if t: return Package(t) return None diff --git a/trunk/src/gentoolkit/package.py b/trunk/src/gentoolkit/package.py index a25d30a..689145f 100644 --- a/trunk/src/gentoolkit/package.py +++ b/trunk/src/gentoolkit/package.py @@ -8,6 +8,8 @@ # $Header$ from errors import FatalError +import portage +from gentoolkit import * class Package: """Package descriptor. Contains convenience functions for querying the @@ -17,6 +19,7 @@ class Package: def __init__(self,cpv): self._cpv = cpv self._scpv = portage.catpkgsplit(self._cpv) + if not self._scpv: raise FatalError("invalid cpv: %s" % cpv) self._db = None -- 2.26.2