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/
Date: Fri, 27 Dec 2013 11:28:54
Message-Id: 1387983791.1362e25fd787ba80ab92332aa07fc56f2f3d7767.sera@gentoo
1 commit: 1362e25fd787ba80ab92332aa07fc56f2f3d7767
2 Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 25 15:03:11 2013 +0000
4 Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 25 15:03:11 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=1362e25f
7
8 Remove long deprecated options from java-config
9
10 Drop the following options from the java-config client:
11 --set-system-classpath
12 --append-system-classpath
13 --clean-system-classpath
14 --set-user-classpath
15 --append-user-classpath
16 --clean-user-classpath
17
18 ---
19 src/java-config-2 | 111 ------------------------------------------------------
20 1 file changed, 111 deletions(-)
21
22 diff --git a/src/java-config-2 b/src/java-config-2
23 index 8ad2539..81e50b3 100755
24 --- a/src/java-config-2
25 +++ b/src/java-config-2
26 @@ -213,81 +213,6 @@ def set_user_vm(option, opt, value, parser):
27 except InvalidConfigError as e:
28 fatalError("Target file already exists and is not a symlink: %s" % e.file)
29
30 -# Deprecated
31 -def system_classpath_target():
32 - # TODO: MAKE THIS MODULAR!! (compnerd)
33 - return [{'file': manager.eprefix + '/etc/env.d/21java-classpath', 'format': '%s=%s\n' }]
34 -
35 -def user_classpath_target():
36 - # TODO: MAKE THIS MODULAR!! (compnerd)
37 - return [
38 - {'file': os.path.join(os.environ.get("HOME"), '.gentoo' + manager.eprefix + '/java-env-classpath'), 'format': 'export %s=%s\n' },
39 - {'file': os.path.join(os.environ.get("HOME"), '.gentoo' + manager.eprefix + '/java-env-classpath.csh'), 'format': 'setenv %s %s\n' }
40 - ]
41 -# Deprecated
42 -def set_system_classpath(option, opt, value, parser):
43 - deprecation_notice()
44 - if os.getuid() is 0:
45 - pkgs = value.split(',')
46 - manager.set_classpath(system_classpath_target(), pkgs)
47 -
48 - for package in pkgs:
49 - printer._printError("Package %s was not found!" % package)
50 -
51 - update_env()
52 - else:
53 - fatalError("You do not have enough permissions to set the system classpath!")
54 -
55 -# Deprecated
56 -def set_user_classpath(option, opt, value, parser):
57 - deprecation_notice()
58 - pkgs = value.split(',')
59 - manager.set_classpath(user_classpath_target(), pkgs)
60 -
61 - for package in pkgs:
62 - printer._printError("Package %s was not found!" % package)
63 -
64 - user_update_env()
65 -
66 -# Deprecated
67 -def append_system_classpath(option, opt, value, parser):
68 - deprecation_notice()
69 - if os.getuid() is 0:
70 - pkgs = value.split(',')
71 - manager.append_classpath(system_classpath_target(), pkgs)
72 -
73 - for package in pkgs:
74 - printer._printError("Package %s was not found!" % package)
75 -
76 - update_env()
77 - else:
78 - fatalError("You do not have enough permissioins to append to the system classpath!")
79 -
80 -# Deprecated
81 -def append_user_classpath(option, opt, value, parser):
82 - deprecation_notice()
83 - pkgs = value.split(',')
84 - manager.append_classpath(user_classpath_target(), pkgs)
85 -
86 - for package in pkgs:
87 - printer._printError("Package %s was not found!" % package)
88 -
89 - user_update_env()
90 -
91 -# Deprecated
92 -def clean_system_classpath(option, opt, value, parser):
93 - deprecation_notice()
94 - if os.getuid() is 0:
95 - manager.clean_classpath(system_classpath_target())
96 - update_env()
97 - else:
98 - fatalError("You do not have enough permissions to clean the system classpath!")
99 -
100 -# Deprecated
101 -def clean_user_classpath(option, opt, value, parser):
102 - deprecation_notice()
103 - manager.clean_classpath(user_classpath_target())
104 -
105 def select_vm(option, opt, value, parser):
106 if value == '':
107 return
108 @@ -298,15 +223,6 @@ def select_vm(option, opt, value, parser):
109 else:
110 fatalError("The vm could not be found")
111
112 -def update_env():
113 - printer._print(getoutput(manager.eprefix + "/usr/sbin/env-update"))
114 - printer._printAlert("If you want the changes too take effect in your current session, you should update\n\
115 - your environment by running: source " + manager.eprefix + "/etc/profile")
116 -
117 -def user_update_env():
118 - printer._printAlert("Environment files in ~/.gentoo" + manager.eprefix + "/ have been updated. You should source these from your shell's profile.\n\
119 - If you want the changes too take effect in your current sessiosn, you should resource these files")
120 -
121 def deprecation_notice():
122 printer._printWarning("Setting a user and system classpath is deprecated, this option will be removed from future versions.")
123
124 @@ -428,33 +344,6 @@ if __name__ == '__main__':
125 help="Set the default Java VM for the user")
126 parser.add_option_group(group)
127
128 - # Doomed
129 - group = OptionGroup(parser, "TO BE REMOVED",
130 - "Those options will soon be removed.")
131 - group.add_option("-A", "--set-system-classpath",
132 - action="callback", callback=set_system_classpath,
133 - type="string", dest="package(s)",
134 - help="Set the system classpath to include the libraries")
135 - group.add_option("-B", "--append-system-classpath",
136 - action="callback", callback=append_system_classpath,
137 - type="string", dest="package(s)",
138 - help="Append the libraries to the system classpath")
139 - group.add_option("-X", "--clean-system-classpath",
140 - action="callback", callback=clean_system_classpath,
141 - help="Clean the current system classpath")
142 - group.add_option("-a", "--set-user-classpath",
143 - action="callback", callback=set_user_classpath,
144 - type="string", dest="package(s)",
145 - help="Set the user classpath to include the libraries")
146 - group.add_option("-b", "--append-user-classpath",
147 - action="callback", callback=append_user_classpath,
148 - type="string", dest="package(s)",
149 - help="Append the libraries to the user classpath")
150 - group.add_option("-x", "--clean-user-classpath",
151 - action="callback", callback=clean_user_classpath,
152 - help="Clean the current user classpath")
153 - parser.add_option_group(group)
154 -
155 if len(sys.argv) < 2:
156 parser.print_help()
157 else: