aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@aura-online.co.uk>2011-11-02 15:20:37 +0000
committerJames Le Cuirot <chewi@aura-online.co.uk>2011-11-02 15:20:37 +0000
commit3160652e2a17cfea4c9dfaa13345bc21c54913aa (patch)
tree38f207ae78c33fa9b81ae3070cf93ebeb15cc608
parent[gjl] Remove pointless : trim. Bash alone can handle it. (diff)
downloadjava-config-3160652e2a17cfea4c9dfaa13345bc21c54913aa.tar.gz
java-config-3160652e2a17cfea4c9dfaa13345bc21c54913aa.tar.bz2
java-config-3160652e2a17cfea4c9dfaa13345bc21c54913aa.zip
[java-config] Use a list instead of a set to build a package's classpath to ensure the order is preserved.
svn path=/projects/java-config-2/trunk/; revision=8878
-rwxr-xr-xsrc/java-config-21
-rw-r--r--src/java_config_2/EnvironmentManager.py15
2 files changed, 8 insertions, 8 deletions
diff --git a/src/java-config-2 b/src/java-config-2
index ac97bf1..a28e596 100755
--- a/src/java-config-2
+++ b/src/java-config-2
@@ -77,7 +77,6 @@ def query_pkg_path(option, opt, value, parser, query):
error = False
try:
packages = value.split(',')
- path = set()
missing_deps = set()
if not parser.values.with_deps:
path = manager.build_path(packages, query)
diff --git a/src/java_config_2/EnvironmentManager.py b/src/java_config_2/EnvironmentManager.py
index a9c956c..c26f9ef 100644
--- a/src/java_config_2/EnvironmentManager.py
+++ b/src/java_config_2/EnvironmentManager.py
@@ -279,11 +279,11 @@ class EnvironmentManager(object):
def add_path_elements(self, elements, path):
if elements:
for p in elements.split(':'):
- if p != '':
- path.add(p)
+ if p != '' and p not in path:
+ path.append(p)
def build_path(self, pkgs, query):
- path = set()
+ path = []
for lpath in self.query_packages(pkgs, query):
self.add_path_elements(lpath, path)
@@ -325,11 +325,11 @@ class EnvironmentManager(object):
self.add_path_elements(pkg_cp, classpath)
else:
for cp in pkg_cp.split(':'):
- if basename(cp) == dep[0]:
- classpath.add(cp)
+ if basename(cp) == dep[0] and cp not in classpath:
+ classpath.append(cp)
def build_dep_path(self, pkgs, query, missing_deps):
- path = set()
+ path = []
unresolved = set()
resolved = set()
@@ -447,7 +447,8 @@ class EnvironmentManager(object):
oldClasspath = None
for target in targets:
for cp in self.get_old_classpath(target).split(':'):
- classpath.add(cp)
+ if cp not in classpath:
+ classpath.append(cp)
self.clean_classpath(targets)