commit 191f59d902123366c3a89f01ce2892f473a2b1ac
Author: Michal Srb <msrb(a)redhat.com>
Date: Tue Dec 2 15:37:51 2014 +0100
[osgi] Get rid of OSGiResolver class
python/javapackages/common/osgi.py | 46 +-----------------------------------
1 files changed, 1 insertions(+), 45 deletions(-)
---
diff --git a/python/javapackages/common/osgi.py b/python/javapackages/common/osgi.py
index b4cfb47..b277b78 100644
--- a/python/javapackages/common/osgi.py
+++ b/python/javapackages/common/osgi.py
@@ -160,47 +160,6 @@ class OSGiBundle(object):
version=version or self.version)
-class OSGiResolver(object):
-
- # FIXME: make it configurable
- _binpath = "/usr/share/java-utils/p2-install"
-
- @staticmethod
- def process_metadata(metadata, scl=None):
- artifacts = metadata.get_provided_artifacts()
- paths = []
- paths.extend([x.get_buildroot_path() for x in artifacts])
- return OSGiResolver.process_paths(paths, scl=scl)
-
- @staticmethod
- def process_path(path, scl=None):
- bundle = OSGiResolver.process_paths([path], scl=scl)
- if bundle:
- return bundle[0]
- return None
-
- @staticmethod
- def process_paths(paths, scl=None):
- return OSGiResolver._call_script(paths, scl=scl)
-
- @staticmethod
- def is_available():
- if os.path.exists(OSGiResolver._binpath):
- return True
- return False
-
- @staticmethod
- def _call_script(paths, scl=None):
- args = "--name rpmdepgen --dry-run --print-deps"
- rc, stdout, stderr = execute_command(OSGiResolver._binpath,
- args=args.split(),
- enable_scl=scl)
- if rc != 0:
- raise Exception(stderr)
- result = stdout.split("\n")[:-1]
- return [OSGiBundle.from_string(x) for x in result]
-
-
def check_path_in_metadata(path, cachedir_path):
buildroot = config.get_buildroot()
@@ -265,10 +224,7 @@ class OSGiCache(object):
bundle_paths = self._find_possible_bundles()
for path in bundle_paths:
- if OSGiResolver.is_available():
- bundle = OSGiResolver.process_path(path, scl=self._scl)
- else:
- bundle = OSGiBundle.from_manifest(path)
+ bundle = OSGiBundle.from_manifest(path)
if bundle:
cache.update({path: bundle})