summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlastimil Babka <caster@gentoo.org>2007-05-28 19:25:57 +0000
committerVlastimil Babka <caster@gentoo.org>2007-05-28 19:25:57 +0000
commitedab441ad3d4f6d9715c250c96d7217970c2f669 (patch)
treebda8d0dfdaa025f954aeb3499a101f8d4c9df0d2 /dev-java/java-config/files
parentMangle the patch to stop a cvs Id from corrupting it. (diff)
downloadgentoo-2-edab441ad3d4f6d9715c250c96d7217970c2f669.tar.gz
gentoo-2-edab441ad3d4f6d9715c250c96d7217970c2f669.tar.bz2
gentoo-2-edab441ad3d4f6d9715c250c96d7217970c2f669.zip
Revbump for support for OPTIONAL_DEPEND in package.env, bug #176182. Also fixes bug #157380. Via patch from trunk.
(Portage version: 2.1.2.7)
Diffstat (limited to 'dev-java/java-config/files')
-rw-r--r--dev-java/java-config/files/digest-java-config-2.0.33-r13
-rw-r--r--dev-java/java-config/files/java-config-2.0.33-r1.patch126
2 files changed, 129 insertions, 0 deletions
diff --git a/dev-java/java-config/files/digest-java-config-2.0.33-r1 b/dev-java/java-config/files/digest-java-config-2.0.33-r1
new file mode 100644
index 000000000000..fe3854bb83bf
--- /dev/null
+++ b/dev-java/java-config/files/digest-java-config-2.0.33-r1
@@ -0,0 +1,3 @@
+MD5 fb714ebd37a8186fa31a87aed99fa2fe java-config-2.0.33.tar.bz2 25491
+RMD160 f8ac8a9c8707ccc62e6258935b4578260f60eaf2 java-config-2.0.33.tar.bz2 25491
+SHA256 3576c22ffd474b02080f257f6ddedd92c453c786f29d893f2d4f7bafc98194da java-config-2.0.33.tar.bz2 25491
diff --git a/dev-java/java-config/files/java-config-2.0.33-r1.patch b/dev-java/java-config/files/java-config-2.0.33-r1.patch
new file mode 100644
index 000000000000..9b49cd53f55e
--- /dev/null
+++ b/dev-java/java-config/files/java-config-2.0.33-r1.patch
@@ -0,0 +1,126 @@
+diff -ru --exclude .svn tags/2.0.33/src/gjl trunk/src/gjl
+--- tags/2.0.33/src/gjl 2007-05-26 11:10:15.000000000 +0200
++++ trunk/src/gjl 2007-05-28 13:59:52.000000000 +0200
+@@ -34,7 +34,7 @@
+ pkg = unresolved.pop()
+ resolved.add(pkg)
+ # dep is in the form of (jar, pkg)
+- for dep in pkg.deps():
++ for dep in manager.get_pkg_deps(pkg):
+ dep_pkg = dep[-1]
+ p = manager.get_package(dep_pkg)
+ if p is None:
+diff -ru --exclude .svn tags/2.0.33/src/java_config/EnvironmentManager.py trunk/src/java_config/EnvironmentManager.py
+--- tags/2.0.33/src/java_config/EnvironmentManager.py 2007-05-26 11:10:15.000000000 +0200
++++ trunk/src/java_config/EnvironmentManager.py 2007-05-28 11:40:03.000000000 +0200
+@@ -263,6 +263,19 @@
+ def build_classpath(self, pkgs):
+ return self.build_path(pkgs, "CLASSPATH")
+
++ def get_pkg_deps(self, pkg):
++ """
++ Returns list of package's deps and optional deps.
++ Filters out optional deps that are not present.
++ """
++ deps = pkg.deps();
++ for opt_dep in pkg.opt_deps():
++ p = self.get_package(opt_dep[-1])
++ if p:
++ deps.append(opt_dep)
++
++ return deps
++
+ def add_dep_classpath(self, pkg, dep, classpath):
+ pkg_cp = pkg.classpath()
+ if pkg_cp:
+@@ -295,7 +308,7 @@
+ lpath = pkg.query(query)
+ self.add_path_elements(lpath, path)
+
+- for dep in pkg.deps():
++ for dep in self.get_pkg_deps(pkg):
+ p = self.get_package(dep[-1])
+
+ if p:
+@@ -344,7 +357,7 @@
+
+ self.add_pkg_env_vars(pkg, env)
+
+- for dep in pkg.deps():
++ for dep in self.get_pkg_deps(pkg):
+ p = self.get_package(dep[-1])
+
+ if p:
+diff -ru --exclude .svn tags/2.0.33/src/java_config/Package.py trunk/src/java_config/Package.py
+--- tags/2.0.33/src/java_config/Package.py 2007-05-26 11:10:15.000000000 +0200
++++ trunk/src/java_config/Package.py 2007-05-28 11:36:50.000000000 +0200
+@@ -55,11 +55,13 @@
+ """
+ Return all packages this package depends on
+ """
+- depstr = self.query("DEPEND")
+- if depstr:
+- return [dep.split("@") for dep in depstr.split(":")]
+- else:
+- return []
++ return self.__get_deps("DEPEND")
++
++ def opt_deps(self):
++ """
++ Return all packages this package optionally depends on
++ """
++ return self.__get_deps("OPTIONAL_DEPEND")
+
+ def provides(self):
+ """
+@@ -69,5 +71,18 @@
+ if pv:
+ return pv.split(" ")
+ return []
++
++ def __get_deps(self, query):
++ """
++ Internal function to get package's (optional) dependencies;
++ @param query: variable to read from package.env
++ """
++ depstr = self.query(query)
++ if depstr:
++ return [dep.split("@") for dep in depstr.split(":")]
++ else:
++ return []
++
++
+
+ # vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:
+diff -ru --exclude .svn tags/2.0.33/src/java_config/VersionManager.py trunk/src/java_config/VersionManager.py
+--- tags/2.0.33/src/java_config/VersionManager.py 2007-05-26 11:10:15.000000000 +0200
++++ trunk/src/java_config/VersionManager.py 2007-05-27 17:43:01.000000000 +0200
+@@ -127,6 +127,7 @@
+
+ prefs = self.get_prefs()
+
++ # first try to find vm based on preferences
+ low = self.get_lowest(atoms) # Lowest vm version we can use
+ for atom in matched_atoms:
+ for pref in prefs:
+@@ -143,12 +144,14 @@
+ else:
+ return gvm # use it!
+
+- low = self.get_lowest_atom(matched_atoms)
+- vm = self.find_vm("", low)
+- if vm:
+- return vm
+- else:
+- raise Exception("Couldn't find suitable VM. Possible invalid dependency string.")
++ # no match in preferences, find anything we have
++ for atom in matched_atoms:
++ vm = self.find_vm("", atom)
++ if vm:
++ return vm
++
++ # nothing found
++ raise Exception("Couldn't find suitable VM. Possible invalid dependency string.")
+
+ def find_vm(self, vm, atom):
+ vm_list = EnvironmentManager().find_vm(vm)