Gentoo Archives: gentoo-java

From: Mathew Robertson <mathew.robertson@××××××××××××××.au>
To:
Cc: gentoo-java@l.g.o
Subject: Re: [gentoo-java] migration/eclass/java-utils.eclass: line 97: [: -ge: unary operator expected
Date: Mon, 01 May 2006 23:46:09
Message-Id: 44569DAB.30403@netratings.com.au
In Reply to: Re: [gentoo-java] migration/eclass/java-utils.eclass: line 97: [: -ge: unary operator expected by Joshua Nichols
1 I was also having similar problems yesterday, as I had just done a
2 system update. re-emerging the java-config-wrapper has solved most of
3 them - thanks for the tip.
4
5 Mathew Robertson
6
7 Joshua Nichols wrote:
8 > Ivan Yosifov wrote:
9 >> Am Donnerstag, 20. April 2006 19:03 schrieb Ivan Yosifov:
10 >>
11 >>> Am Mittwoch, 19. April 2006 18:15 schrieb Joshua Nichols:
12 >>>
13 >>>> Ivan Yosifov wrote:
14 >>>>
15 >>>>> Am Dienstag, 18. April 2006 19:36 schrieb Joshua Nichols:
16 >>>>>
17 >>>>>> Ivan Yosifov wrote:
18 >>>>>>
19 >>>>>>> Hello,
20 >>>>>>>
21 >>>>>>> Happens while emergeing eclipse:
22 >>>>>>>
23 >>>>>>> home ~ # emerge -1 eclipse-sdk
24 >>>>>>> Calculating dependencies... done!
25 >>>>>>>
26 >>>>>>>
27 >>>>>>>>>> Emerging (1 of 1) dev-util/eclipse-sdk-3.1.2 to /
28 >>>>>>>>>> checksums files ....
29 >>>>>>>>>> checksums src_uri ;-) eclipse-sourceBuild-srcIncluded-3.1.2.zip
30 >>>>>>>>>>
31 >>>>>>> * Checking for sufficient physical RAM
32 >>>>>>> * Checking for bad CFLAGS
33 >>>>>>> * Found offending option -fomit-frame-pointer in your CFLAGS
34 >>>>>>> ....
35 >>>>>>> * Tip: use equery depgraph "=eclipse-sdk-3.1.2" to list all
36 >>>>>>> dependencies.
37 >>>>>>>
38 >>>>>>> /usr/local/portage/migration/migration/eclass/java-utils.eclass:
39 >>>>>>> line
40 >>>>>>> 97: [: -ge: unary operator expected
41 >>>>>>> Detected a JDK < 1.5.0
42 >>>>>>> Detected a JDK >= 1.4.2
43 >>>>>>>
44 >>>>>>>
45 >>>>>>>>>> Unpacking source...
46 >>>>>>>>>>
47 >>>>>>> /usr/local/portage/migration/migration/ is where I've put the
48 >>>>>>> migration overlay revision 2114. Bash is 3.1_p17. Is this an eclass
49 >>>>>>> bug or something else ?
50 >>>>>>>
51 >>>>>> Something else, I think. I've been working on the eclipse ebuilds
52 >>>>>> (while using migration-overlay, obviously), and hadn't noticed any
53 >>>>>> problems.
54 >>>>>>
55 >>>>>> It might have something to do with the ebuild itself. Someone
56 >>>>>> went and
57 >>>>>> committed a bump to 3.1.2 without consulting with us Java folks, so
58 >>>>>> I'm not sure what condition it is. Expect to see a new revision in a
59 >>>>>> day or so...
60 >>>>>>
61 >>>>>> Josh
62 >>>>>>
63 >>>>> I am getting the same with the new eclipse-sdk-3.1.2-r1. I added some
64 >>>>> debugging output to the eclass in java-utils_is-vm-version-ge():
65 >>>>>
66 >>>>> --- ./java-utils.eclass 2006-04-19 10:58:43.000000000 +0300
67 >>>>> +++ /usr/local/portage/migration/migration/eclass/java-utils.eclass
68 >>>>> 2006-04-19 11:00:25.000000000 +0300
69 >>>>> @@ -91,6 +91,12 @@
70 >>>>> local vm_patch=$(echo ${vm_version} | cut -d. -f3)
71 >>>>> local vm_extra=$(echo ${vm_version} | cut -d. -f4)
72 >>>>>
73 >>>>> + echo ${vm_major}
74 >>>>> + echo ${vm_minor}
75 >>>>> + echo ${user_major}
76 >>>>> + echo ${user_minor}
77 >>>>> + echo ${vm_patch}
78 >>>>> + echo ${user_patch}
79 >>>>> if [ ${vm_major} -ge ${user_major} ] && [ ${vm_minor} -gt
80 >>>>> ${user_minor} ] ; then
81 >>>>> echo "Detected a JDK >= ${user_version}"
82 >>>>> return 0
83 >>>>>
84 >>>>> and the output is:
85 >>>>>
86 >>>>> * Tip: use equery depgraph "=eclipse-sdk-3.1.2-r1" to list all
87 >>>>> dependencies.
88 >>>>>
89 >>>>> 1
90 >>>>> 5
91 >>>>> 1
92 >>>>> 5
93 >>>>>
94 >>>>> 0
95 >>>>> /usr/local/portage/migration/migration/eclass/java-utils.eclass: line
96 >>>>> 103: [: -ge: unary operator expected
97 >>>>> Detected a JDK < 1.5.0
98 >>>>> 1
99 >>>>> 5
100 >>>>> 1
101 >>>>> 4
102 >>>>>
103 >>>>> 2
104 >>>>> Detected a JDK >= 1.4.2
105 >>>>>
106 >>>>>
107 >>>>>>>> Unpacking source...
108 >>>>>>>>
109 >>>>> ,meaning that vm_patch is ending up empty and that seems to
110 >>>>> confuse -ge
111 >>>>> conditionals using it.
112 >>>>>
113 >>>> I'll have to look into this, but it probably just needs to sanity
114 >>>> checking for the vm_extra and company.
115 >>>>
116 >>>> Aside from that, what is the original of the ebuild for eclipse
117 >>>> that you
118 >>>> are using? Also, which VM are you using? I haven't been able to quite
119 >>>> reproduce this problem...
120 >>>>
121 >>>> Josh
122 >>>>
123 >>> I am using the eclipse-sdk-3.1.2-r1 ebuild from the main tree, attached
124 >>> here for reference. I have sun-jdk 1.4.2.10-r13 and 1.5.0.06-r13
125 >>> installed.
126 >>> The problem with vm_patch seems to be that
127 >>>
128 >>> java-config -f | sed -e "s/.*-\([0-9.]\+\).*/\1/" ( in
129 >>> java-utils_get-vm-version )
130 >>>
131 >>> returns just "1.5" and so
132 >>>
133 >>> vm_patch=$(echo ${vm_version} | cut -d. -f3) ( in
134 >>> java-utils_is-vm-version-ge ) ends up being an empty string. There
135 >>> is no
136 >>> third field to cut.
137 >>>
138 >>
139 >> Still an issue with eclipse-sdk-3.1.2-r2 and migration overlay
140 >> revision 2129.
141 >>
142 >>
143 >
144 > Could you check the contents of /usr/bin/java-config ? If it is a
145 > python script, try remerging java-config-wrapper.
146 >
147 > I just finished helping a user in #gentoo-java that was having the
148 > same issue, and that did the trick.
149 >
150 > Now, I need to track down why it's the original java-config, instead
151 > of the new wrapper for java-config....
152 >
153 > - Josh
154 --
155 gentoo-java@g.o mailing list

Replies