2 package org
.de
.metux
.util
;
6 public Version version
;
7 public String version_str
= "0.0.0.0";
8 public String package_name
;
9 public String depend_str
;
10 public String
[] features
;
12 public Depend (String text
)
14 String
[] myfeatures
= new String
[30];
21 /* this is the position where the name part ends in our string */
25 /* cut out eventual version information */
26 if ((x
=text
.indexOf("(>="))!=-1)
29 throw new RuntimeException("parse error: missing name part");
31 y
=text
.indexOf(')', x
+1);
33 throw new RuntimeException("parse error: missing closing bracket");
35 version_str
= text
.substring(x
+3,y
);
40 /* cut out features */
41 while ((x
=text
.indexOf("[",parse_ptr
))!=-1)
43 if ((y
=text
.indexOf("]",x
+1))==-1)
44 throw new RuntimeException("parse error: missing ]");
45 myfeatures
[num_features
++] = text
.substring(x
+1,y
);
52 features
= new String
[num_features
];
53 for (int a
=0; a
<num_features
; a
++)
55 features
[a
] = myfeatures
[a
];
62 package_name
= text
.substring(0,name_end
);
64 version
= new Version(version_str
);