Gentoo Archives: gentoo-commits

From: Ralph Sennhauser <sera@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
Date: Fri, 27 Dec 2013 11:28:51
Message-Id: 1388142083.8120125c466356fbdcce9365e14a605ece206cb0.sera@gentoo
1 commit: 8120125c466356fbdcce9365e14a605ece206cb0
2 Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 27 11:01:23 2013 +0000
4 Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 27 11:01:23 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=8120125c
7
8 Remove unused functions from EnvironmentManager after commit 1362e25
9
10 ---
11 src/java_config_2/EnvironmentManager.py | 67 ---------------------------------
12 1 file changed, 67 deletions(-)
13
14 diff --git a/src/java_config_2/EnvironmentManager.py b/src/java_config_2/EnvironmentManager.py
15 index 8d47e6e..afb80df 100644
16 --- a/src/java_config_2/EnvironmentManager.py
17 +++ b/src/java_config_2/EnvironmentManager.py
18 @@ -269,14 +269,6 @@ class EnvironmentManager(object):
19 else:
20 return None
21
22 - def clean_classpath(self, targets):
23 - for target in targets:
24 - if os.path.isfile(target['file']):
25 - try:
26 - os.remove(target['file'])
27 - except IOError:
28 - raise PermissionError
29 -
30 def add_path_elements(self, elements, path):
31 if elements:
32 for p in elements.split(':'):
33 @@ -290,9 +282,6 @@ class EnvironmentManager(object):
34
35 return path
36
37 - def build_classpath(self, pkgs):
38 - return self.build_path(pkgs, "CLASSPATH")
39 -
40 def get_pkg_deps(self, pkg):
41 """
42 Returns list of package's deps and optional deps.
43 @@ -413,62 +402,6 @@ class EnvironmentManager(object):
44 missing_deps.add(dep[-1])
45 return env
46
47 - def set_classpath(self, targets, pkgs):
48 - classpath = self.build_classpath(pkgs)
49 -
50 - if classpath:
51 - self.clean_classpath(targets)
52 -
53 - self.write_classpath(targets, classpath)
54 -
55 - def get_old_classpath(self, target):
56 - """Returns the current set classpath in the file"""
57 - oldClasspath = ''
58 - if os.path.isfile(target['file']):
59 - try:
60 - stream = open(target['file'], 'r')
61 - except IOError:
62 - raise PermissionError
63 -
64 - for line in stream:
65 - line = line.strip(' \n')
66 - if line.find('CLASSPATH') != -1:
67 - try:
68 - oldClasspath = line.split(target['format'].split('%s')[-2])[-1].strip()
69 - except:
70 - pass
71 - stream.close()
72 -
73 - return oldClasspath
74 -
75 - def append_classpath(self, targets, pkgs):
76 - classpath = self.build_classpath(pkgs)
77 -
78 - if classpath:
79 - oldClasspath = None
80 - for target in targets:
81 - for cp in self.get_old_classpath(target).split(':'):
82 - if cp not in classpath:
83 - classpath.append(cp)
84 -
85 - self.clean_classpath(targets)
86 -
87 - self.write_classpath(targets, classpath)
88 -
89 - def write_classpath(self, targets, classpath):
90 - for target in targets:
91 - dir = dirname(target['file'])
92 - if not os.path.isdir(dir):
93 - os.makedirs(dir)
94 -
95 - try:
96 - stream = open(target['file'], 'w')
97 - except IOError:
98 - raise PermissionError
99 -
100 - stream.write(target['format'] % ("CLASSPATH", ':'.join(classpath)))
101 - stream.close()
102 -
103 def have_provider(self, virtuals, virtualMachine, versionManager):
104 result=True
105 storeVM = self.get_active_vm()