From b0cd34ed75d202306999a35cd827899cefd61ab2 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Sat, 21 Jul 2012 07:36:35 +0200 Subject: [PATCH] djeuscan: portage. can be used instead of PORTDB Signed-off-by: Corentin Chary --- euscanwww/djeuscan/processing/scan/scan_portage.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/euscanwww/djeuscan/processing/scan/scan_portage.py b/euscanwww/djeuscan/processing/scan/scan_portage.py index a30254e..79fa62a 100644 --- a/euscanwww/djeuscan/processing/scan/scan_portage.py +++ b/euscanwww/djeuscan/processing/scan/scan_portage.py @@ -13,9 +13,6 @@ from euscan.version import get_version_type from djeuscan.processing import FakeLogger from djeuscan.models import Package, Version, VersionLog -PORTDB = None - - class ScanPortage(object): def __init__(self, logger=None, no_log=False, purge_packages=False, purge_versions=False): @@ -24,10 +21,6 @@ class ScanPortage(object): self.purge_packages = purge_packages self.purge_versions = purge_versions - global PORTDB - if not PORTDB: # Lazy loading for portdb - PORTDB = portage.db[portage.root]["porttree"].dbapi - self.style = color_style() self._cache = {'packages': {}, 'versions': {}} @@ -231,7 +224,7 @@ class ScanPortage(object): package.category, package.name, ver, rev, slot, overlay ) - overlay_path = overlay_path or PORTDB.settings["PORTDIR"] + overlay_path = overlay_path or portage.settings["PORTDIR"] package_path = join(overlay_path, package.category, package.name) ebuild_path = join(package_path, "%s.ebuild" % cpv.split("/")[-1]) metadata_path = join(package_path, "metadata.xml")