Mercurial > hg > truffle
diff mxtool/mx.py @ 14940:82971f397b94
mx.JavaConfig: filter non-existant paths from bootclasspath, extdirs and endorseddirs
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 02 Apr 2014 14:19:38 +0200 |
parents | dd5095578b79 |
children | e1ce6c66f56e |
line wrap: on
line diff
--- a/mxtool/mx.py Wed Apr 02 14:11:26 2014 +0200 +++ b/mxtool/mx.py Wed Apr 02 14:19:38 2014 +0200 @@ -1380,6 +1380,9 @@ def __cmp__(self, other): return cmp(self.parts, other.parts) +def _filter_non_existant_paths(paths): + return os.pathsep.join([path for path in paths.split(os.pathsep) if exists(path)]) + """ A JavaConfig object encapsulates info on how Java commands are run. """ @@ -1431,6 +1434,9 @@ self._bootclasspath, self._extdirs, self._endorseddirs = [x if x != 'null' else None for x in subprocess.check_output([self.java, '-cp', myDir, 'ClasspathDump']).split('|')] if not self._bootclasspath or not self._extdirs or not self._endorseddirs: warn("Could not find all classpaths: boot='" + str(self._bootclasspath) + "' extdirs='" + str(self._extdirs) + "' endorseddirs='" + str(self._endorseddirs) + "'") + self._bootclasspath = _filter_non_existant_paths(self._bootclasspath) + self._extdirs = _filter_non_existant_paths(self._extdirs) + self._endorseddirs = _filter_non_existant_paths(self._endorseddirs) def __hash__(self): return hash(self.jdk)