Gentoo Archives: gentoo-java

From: Ivan Yosifov <ivan@×××××××.net>
To: gentoo-java@l.g.o
Cc: Joshua Nichols <nichoj@g.o>
Subject: Re: [gentoo-java] migration/eclass/java-utils.eclass: line 97: [: -ge: unary operator expected
Date: Tue, 02 May 2006 18:05:40
Message-Id: 200605022101.46157.ivan@yosifov.net
In Reply to: Re: [gentoo-java] migration/eclass/java-utils.eclass: line 97: [: -ge: unary operator expected by Joshua Nichols
1 Ok...
2
3 I updated migration overlay to revision 2153. Reemerged and updated both
4 java-config and java-config-wrapper. I now have java-config 2.0.22 and
5 1.3.0-r2 installed, java-config-wrapper is 0.8-r2. /usr/bin/java-config is:
6
7 #!/bin/bash
8
9 WANT_JAVA_CONFIG=${WANT_JAVA_CONFIG:="2"}
10
11 JAVA_CONFIG="/usr/bin/java-config-${WANT_JAVA_CONFIG}"
12
13 if [[ -x ${JAVA_CONFIG} ]]; then
14 exec ${JAVA_CONFIG} "$@"
15 else
16 echo "ERROR: Expected to find ${JAVA_CONFIG}"
17
18 While emerging eclipse I (still) get:
19
20 home ~ # emerge -1 eclipse-sdk
21 Calculating dependencies... done!
22 >>> Emerging (1 of 1) dev-util/eclipse-sdk-3.1.2-r2 to /
23 >>> checking ebuild checksums
24 >>> checking auxfile checksums
25 >>> checking miscfile checksums
26 >>> checking distfiles checksums
27 * Checking for at least 768MBytes RAM ...
28 [ ok ]
29 true
30 * Found offending option -fomit-frame-pointer in your CFLAGS
31
32 * One or more potentially gruesome CFLAGS detected. When you run into
33 trouble,
34 * please edit /etc/make.conf and remove all offending flags, then recompile
35 * Eclipse and all its dependencies before submitting a bug report.
36
37 * In particular, gtk+ is extremely sensitive to which which flags it was
38 * compiled with.
39
40 * Tip: use equery depgraph "=eclipse-sdk-3.1.2-r2" to list all dependencies.
41
42 Cannot find JAVA_HOME in config file /etc/env.d/java/22sun-j2ee-1.3.1
43 Cannot find JAVA_HOME in config file /etc/env.d/java/22sun-j2ee-1.3.1
44 Detected a JDK < 1.5.0
45 Cannot find JAVA_HOME in config file /etc/env.d/java/22sun-j2ee-1.3.1
46 Detected a JDK >= 1.4.2
47 >>> Unpacking source...
48
49 The env file seems to come from dev-java/sun-j2ee-1.3.1-r3 but that should be
50 an unrelated problem. Please correct me if I am wrong but line 91 of
51 java-utils.eclass:
52
53 local vm_patch=$(echo ${vm_version} | cut -d. -f3)
54
55 _really_ expects a 3-component vm_version, like 1.2.3. And here java-config -f
56 returns sun-jdk-1.5, that means a 2-component version "1.5". I described that
57 my last mail and still feel this is the issue at least in my case.
58
59 Am Dienstag, 2. Mai 2006 06:53 schrieb Joshua Nichols:
60 > I found the root of the problem. java-config-wrapper was installing
61 > /usr/bin/java-config. This is basically a wrapper, as the name suggests.
62 > java-config-1 was installing /usr/bin/java-config-1. This was the old
63 > school java-config. java-config-2 was installing /usr/bin/java-config-2
64 > .... AND installing the same thing to /usr/bin/java-config. A bit of an
65 > oversight on my part, so my apologies for the inconvenience.
66 >
67 > To fix this, I've bumped to java-config-2.0.22 and
68 > java-config-wrapper-0.8-r2. Please update to these versions. I can't
69 > stress how important it is keep everything in the overlay up to date,
70 > because packages will be bumped as bugs are found and fixed.
71 >
72 > Regardes,
73 >
74 > Josh
75 >
76 > Mathew Robertson wrote:
77 > > I was also having similar problems yesterday, as I had just done a
78 > > system update. re-emerging the java-config-wrapper has solved most of
79 > > them - thanks for the tip.
80 > >
81 > > Mathew Robertson
82 > >
83 > > Joshua Nichols wrote:
84 > >> Ivan Yosifov wrote:
85 > >>> Am Donnerstag, 20. April 2006 19:03 schrieb Ivan Yosifov:
86 > >>>> Am Mittwoch, 19. April 2006 18:15 schrieb Joshua Nichols:
87 > >>>>> Ivan Yosifov wrote:
88 > >>>>>> Am Dienstag, 18. April 2006 19:36 schrieb Joshua Nichols:
89 > >>>>>>> Ivan Yosifov wrote:
90 > >>>>>>>> Hello,
91 > >>>>>>>>
92 > >>>>>>>> Happens while emergeing eclipse:
93 > >>>>>>>>
94 > >>>>>>>> home ~ # emerge -1 eclipse-sdk
95 > >>>>>>>> Calculating dependencies... done!
96 > >>>>>>>>
97 > >>>>>>>>>>> Emerging (1 of 1) dev-util/eclipse-sdk-3.1.2 to /
98 > >>>>>>>>>>> checksums files ....
99 > >>>>>>>>>>> checksums src_uri ;-) eclipse-sourceBuild-srcIncluded-3.1.2.zip
100 > >>>>>>>>
101 > >>>>>>>> * Checking for sufficient physical RAM
102 > >>>>>>>> * Checking for bad CFLAGS
103 > >>>>>>>> * Found offending option -fomit-frame-pointer in your CFLAGS
104 > >>>>>>>> ....
105 > >>>>>>>> * Tip: use equery depgraph "=eclipse-sdk-3.1.2" to list all
106 > >>>>>>>> dependencies.
107 > >>>>>>>>
108 > >>>>>>>> /usr/local/portage/migration/migration/eclass/java-utils.eclass:
109 > >>>>>>>> line
110 > >>>>>>>> 97: [: -ge: unary operator expected
111 > >>>>>>>> Detected a JDK < 1.5.0
112 > >>>>>>>> Detected a JDK >= 1.4.2
113 > >>>>>>>>
114 > >>>>>>>>>>> Unpacking source...
115 > >>>>>>>>
116 > >>>>>>>> /usr/local/portage/migration/migration/ is where I've put the
117 > >>>>>>>> migration overlay revision 2114. Bash is 3.1_p17. Is this an
118 > >>>>>>>> eclass
119 > >>>>>>>> bug or something else ?
120 > >>>>>>>
121 > >>>>>>> Something else, I think. I've been working on the eclipse ebuilds
122 > >>>>>>> (while using migration-overlay, obviously), and hadn't noticed any
123 > >>>>>>> problems.
124 > >>>>>>>
125 > >>>>>>> It might have something to do with the ebuild itself. Someone
126 > >>>>>>> went and
127 > >>>>>>> committed a bump to 3.1.2 without consulting with us Java folks, so
128 > >>>>>>> I'm not sure what condition it is. Expect to see a new revision
129 > >>>>>>> in a
130 > >>>>>>> day or so...
131 > >>>>>>>
132 > >>>>>>> Josh
133 > >>>>>>
134 > >>>>>> I am getting the same with the new eclipse-sdk-3.1.2-r1. I added
135 > >>>>>> some
136 > >>>>>> debugging output to the eclass in java-utils_is-vm-version-ge():
137 > >>>>>>
138 > >>>>>> --- ./java-utils.eclass 2006-04-19 10:58:43.000000000 +0300
139 > >>>>>> +++ /usr/local/portage/migration/migration/eclass/java-utils.eclass
140 > >>>>>> 2006-04-19 11:00:25.000000000 +0300
141 > >>>>>> @@ -91,6 +91,12 @@
142 > >>>>>> local vm_patch=$(echo ${vm_version} | cut -d. -f3)
143 > >>>>>> local vm_extra=$(echo ${vm_version} | cut -d. -f4)
144 > >>>>>>
145 > >>>>>> + echo ${vm_major}
146 > >>>>>> + echo ${vm_minor}
147 > >>>>>> + echo ${user_major}
148 > >>>>>> + echo ${user_minor}
149 > >>>>>> + echo ${vm_patch}
150 > >>>>>> + echo ${user_patch}
151 > >>>>>> if [ ${vm_major} -ge ${user_major} ] && [ ${vm_minor} -gt
152 > >>>>>> ${user_minor} ] ; then
153 > >>>>>> echo "Detected a JDK >= ${user_version}"
154 > >>>>>> return 0
155 > >>>>>>
156 > >>>>>> and the output is:
157 > >>>>>>
158 > >>>>>> * Tip: use equery depgraph "=eclipse-sdk-3.1.2-r1" to list all
159 > >>>>>> dependencies.
160 > >>>>>>
161 > >>>>>> 1
162 > >>>>>> 5
163 > >>>>>> 1
164 > >>>>>> 5
165 > >>>>>>
166 > >>>>>> 0
167 > >>>>>> /usr/local/portage/migration/migration/eclass/java-utils.eclass:
168 > >>>>>> line
169 > >>>>>> 103: [: -ge: unary operator expected
170 > >>>>>> Detected a JDK < 1.5.0
171 > >>>>>> 1
172 > >>>>>> 5
173 > >>>>>> 1
174 > >>>>>> 4
175 > >>>>>>
176 > >>>>>> 2
177 > >>>>>> Detected a JDK >= 1.4.2
178 > >>>>>>
179 > >>>>>>>>> Unpacking source...
180 > >>>>>>
181 > >>>>>> ,meaning that vm_patch is ending up empty and that seems to
182 > >>>>>> confuse -ge
183 > >>>>>> conditionals using it.
184 > >>>>>
185 > >>>>> I'll have to look into this, but it probably just needs to sanity
186 > >>>>> checking for the vm_extra and company.
187 > >>>>>
188 > >>>>> Aside from that, what is the original of the ebuild for eclipse
189 > >>>>> that you
190 > >>>>> are using? Also, which VM are you using? I haven't been able to
191 > >>>>> quite
192 > >>>>> reproduce this problem...
193 > >>>>>
194 > >>>>> Josh
195 > >>>>
196 > >>>> I am using the eclipse-sdk-3.1.2-r1 ebuild from the main tree,
197 > >>>> attached
198 > >>>> here for reference. I have sun-jdk 1.4.2.10-r13 and 1.5.0.06-r13
199 > >>>> installed.
200 > >>>> The problem with vm_patch seems to be that
201 > >>>>
202 > >>>> java-config -f | sed -e "s/.*-\([0-9.]\+\).*/\1/" ( in
203 > >>>> java-utils_get-vm-version )
204 > >>>>
205 > >>>> returns just "1.5" and so
206 > >>>>
207 > >>>> vm_patch=$(echo ${vm_version} | cut -d. -f3) ( in
208 > >>>> java-utils_is-vm-version-ge ) ends up being an empty string. There
209 > >>>> is no
210 > >>>> third field to cut.
211 > >>>
212 > >>> Still an issue with eclipse-sdk-3.1.2-r2 and migration overlay
213 > >>> revision 2129.
214 > >>
215 > >> Could you check the contents of /usr/bin/java-config ? If it is a
216 > >> python script, try remerging java-config-wrapper.
217 > >>
218 > >> I just finished helping a user in #gentoo-java that was having the
219 > >> same issue, and that did the trick.
220 > >>
221 > >> Now, I need to track down why it's the original java-config, instead
222 > >> of the new wrapper for java-config....
223 > >>
224 > >> - Josh
225
226 --
227 Cheers,
228 Ivan Yosifov.
229 --
230 gentoo-java@g.o mailing list

Replies