1 |
117 |
jt_eaton |
#/**********************************************************************/
|
2 |
|
|
#/* */
|
3 |
|
|
#/* ------- */
|
4 |
|
|
#/* / SOC \ */
|
5 |
|
|
#/* / GEN \ */
|
6 |
|
|
#/* / TOOL \ */
|
7 |
|
|
#/* ============== */
|
8 |
|
|
#/* | | */
|
9 |
|
|
#/* |____________| */
|
10 |
|
|
#/* */
|
11 |
|
|
#/* */
|
12 |
|
|
#/* */
|
13 |
|
|
#/* Author(s): */
|
14 |
|
|
#/* - John Eaton, jt_eaton@opencores.org */
|
15 |
|
|
#/* */
|
16 |
|
|
#/**********************************************************************/
|
17 |
|
|
#/* */
|
18 |
|
|
#/* Copyright (C) <2010-2011> <Ouabache Design Works> */
|
19 |
|
|
#/* */
|
20 |
|
|
#/* This source file may be used and distributed without */
|
21 |
|
|
#/* restriction provided that this copyright statement is not */
|
22 |
|
|
#/* removed from the file and that any derivative work contains */
|
23 |
|
|
#/* the original copyright notice and the associated disclaimer. */
|
24 |
|
|
#/* */
|
25 |
|
|
#/* This source file is free software; you can redistribute it */
|
26 |
|
|
#/* and/or modify it under the terms of the GNU Lesser General */
|
27 |
|
|
#/* Public License as published by the Free Software Foundation; */
|
28 |
|
|
#/* either version 2.1 of the License, or (at your option) any */
|
29 |
|
|
#/* later version. */
|
30 |
|
|
#/* */
|
31 |
|
|
#/* This source is distributed in the hope that it will be */
|
32 |
|
|
#/* useful, but WITHOUT ANY WARRANTY; without even the implied */
|
33 |
|
|
#/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
|
34 |
|
|
#/* PURPOSE. See the GNU Lesser General Public License for more */
|
35 |
|
|
#/* details. */
|
36 |
|
|
#/* */
|
37 |
|
|
#/* You should have received a copy of the GNU Lesser General */
|
38 |
|
|
#/* Public License along with this source; if not, download it */
|
39 |
|
|
#/* from http://www.opencores.org/lgpl.shtml */
|
40 |
|
|
#/* */
|
41 |
|
|
#/**********************************************************************/
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
use strict;
|
49 |
|
|
|
50 |
|
|
package yp::lib;
|
51 |
|
|
|
52 |
|
|
|
53 |
118 |
jt_eaton |
#/***********************************************************************************************/
|
54 |
|
|
#/ find_ipxact */
|
55 |
|
|
#/ */
|
56 |
|
|
#/ returns full path name to ip-xact file */
|
57 |
|
|
#/ */
|
58 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact($type,$vendor,$library,$component,$version); */
|
59 |
|
|
#/ */
|
60 |
|
|
#/***********************************************************************************************/
|
61 |
117 |
jt_eaton |
|
62 |
118 |
jt_eaton |
sub find_ipxact
|
63 |
117 |
jt_eaton |
{
|
64 |
|
|
my @params = @_;
|
65 |
|
|
my $version = pop(@params);
|
66 |
|
|
my $component = pop(@params);
|
67 |
|
|
my $project = pop(@params);
|
68 |
|
|
my $vendor = pop(@params);
|
69 |
|
|
my $type = pop(@params);
|
70 |
|
|
|
71 |
|
|
|
72 |
118 |
jt_eaton |
my $card_file_name;
|
73 |
|
|
my $card_dir_name;
|
74 |
|
|
|
75 |
|
|
my $parser = XML::LibXML->new();
|
76 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/hier_index.xml");
|
77 |
|
|
|
78 |
|
|
foreach my $i_vendor ($yp_index_file->findnodes("//socgen:file_types/socgen:file_type[socgen:name/text() = '$type']/socgen:vendors/socgen:vendor[socgen:name/text() = '$vendor']/socgen:libraries/socgen:library[socgen:name/text() = '$project']/socgen:components/socgen:component[socgen:name/text() = '$component']/socgen:versions/socgen:version[socgen:name/text() = '$version']"))
|
79 |
|
|
{
|
80 |
|
|
$card_file_name = $i_vendor->findnodes('./socgen:file_name/text()')->to_literal ;
|
81 |
|
|
$card_dir_name = $i_vendor->findnodes('./socgen:dir_name/text()')->to_literal ;
|
82 |
|
|
return("./${card_dir_name}/${card_file_name}");
|
83 |
|
|
}
|
84 |
|
|
return("");
|
85 |
|
|
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
120 |
jt_eaton |
|
95 |
|
|
|
96 |
118 |
jt_eaton |
#/*****************************************************************************************************/
|
97 |
120 |
jt_eaton |
#/ find_ipxact_design_files */
|
98 |
118 |
jt_eaton |
#/ */
|
99 |
120 |
jt_eaton |
#/ returns parser tokens to ip-xact design files referred to by component file vlnv */
|
100 |
118 |
jt_eaton |
#/ */
|
101 |
120 |
jt_eaton |
#/ my @spirit_design_files = yp::lib::find_ipxact_design_file($vendor,$library,$component,$version); */
|
102 |
118 |
jt_eaton |
#/ */
|
103 |
|
|
#/*****************************************************************************************************/
|
104 |
|
|
|
105 |
120 |
jt_eaton |
sub find_ipxact_design_files
|
106 |
118 |
jt_eaton |
{
|
107 |
|
|
my @params = @_;
|
108 |
|
|
my $version = pop(@params);
|
109 |
|
|
my $component = pop(@params);
|
110 |
|
|
my $project = pop(@params);
|
111 |
|
|
my $vendor = pop(@params);
|
112 |
|
|
|
113 |
|
|
|
114 |
117 |
jt_eaton |
my $card_type;
|
115 |
|
|
my $card_file_name;
|
116 |
|
|
my $card_dir_name;
|
117 |
|
|
my $card_vendor;
|
118 |
|
|
my $card_library;
|
119 |
|
|
my $card_component;
|
120 |
|
|
my $card_version;
|
121 |
|
|
|
122 |
120 |
jt_eaton |
my @design_files = ();
|
123 |
|
|
|
124 |
117 |
jt_eaton |
my $parser = XML::LibXML->new();
|
125 |
118 |
jt_eaton |
my $yp_index_file = $parser->parse_file("./tools/yp/hier_index.xml");
|
126 |
117 |
jt_eaton |
|
127 |
118 |
jt_eaton |
unless (yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version)){print "Missing Component $vendor, $project, $component, $version \n"; }
|
128 |
117 |
jt_eaton |
|
129 |
118 |
jt_eaton |
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
|
130 |
117 |
jt_eaton |
|
131 |
118 |
jt_eaton |
foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
|
132 |
|
|
{
|
133 |
120 |
jt_eaton |
my($hier_ref_vendor) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
|
134 |
|
|
my($hier_ref_library) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
|
135 |
|
|
my($hier_ref_component) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
|
136 |
|
|
my($hier_ref_version) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
|
137 |
117 |
jt_eaton |
|
138 |
118 |
jt_eaton |
|
139 |
117 |
jt_eaton |
|
140 |
120 |
jt_eaton |
if(yp::lib::find_ipxact("spirit:designConfiguration",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ))
|
141 |
|
|
{
|
142 |
117 |
jt_eaton |
|
143 |
120 |
jt_eaton |
my $spirit_designCfg_file
|
144 |
|
|
= $parser->parse_file(yp::lib::find_ipxact("spirit:designConfiguration",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ));
|
145 |
|
|
|
146 |
|
|
foreach my $design_ref_view ($spirit_designCfg_file->findnodes('//spirit:designConfiguration'))
|
147 |
|
|
{
|
148 |
|
|
($hier_ref_vendor) = $design_ref_view->findnodes('./spirit:designRef/@spirit:vendor')->to_literal ;
|
149 |
|
|
($hier_ref_library) = $design_ref_view->findnodes('./spirit:designRef/@spirit:library')->to_literal ;
|
150 |
|
|
($hier_ref_component) = $design_ref_view->findnodes('./spirit:designRef/@spirit:name')->to_literal ;
|
151 |
|
|
($hier_ref_version) = $design_ref_view->findnodes('./spirit:designRef/@spirit:version')->to_literal ;
|
152 |
118 |
jt_eaton |
|
153 |
117 |
jt_eaton |
|
154 |
120 |
jt_eaton |
}
|
155 |
118 |
jt_eaton |
|
156 |
|
|
|
157 |
|
|
}
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
|
162 |
120 |
jt_eaton |
foreach my $index_card ($yp_index_file->findnodes("//socgen:file_types/socgen:file_type[socgen:name/text() = 'spirit:design']/socgen:vendors/socgen:vendor[socgen:name/text() = '$hier_ref_vendor']/socgen:libraries/socgen:library[socgen:name/text() = '$hier_ref_library']/socgen:components/socgen:component[socgen:name/text() = '$hier_ref_component']/socgen:versions/socgen:version[socgen:name/text() = '$hier_ref_version']"))
|
163 |
|
|
{
|
164 |
|
|
push(@design_files,$parser->parse_file(yp::lib::find_ipxact("spirit:design",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version )));
|
165 |
|
|
};
|
166 |
118 |
jt_eaton |
|
167 |
|
|
|
168 |
|
|
}
|
169 |
120 |
jt_eaton |
return(@design_files);
|
170 |
118 |
jt_eaton |
}
|
171 |
|
|
|
172 |
|
|
|
173 |
|
|
|
174 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
175 |
|
|
#/ find_ipxact_file */
|
176 |
|
|
#/ */
|
177 |
|
|
#/ returns local name of the ip-xact file */
|
178 |
|
|
#/ */
|
179 |
118 |
jt_eaton |
#/ my $file_name = yp::lib::find_ipxact_file($type,$vendor,$library,$component,$version); */
|
180 |
117 |
jt_eaton |
#/ */
|
181 |
|
|
#/*********************************************************************************************/
|
182 |
|
|
|
183 |
|
|
sub find_ipxact_file
|
184 |
|
|
{
|
185 |
|
|
my @params = @_;
|
186 |
|
|
my $version = pop(@params);
|
187 |
|
|
my $component = pop(@params);
|
188 |
|
|
my $project = pop(@params);
|
189 |
|
|
my $vendor = pop(@params);
|
190 |
|
|
my $type = pop(@params);
|
191 |
|
|
|
192 |
|
|
|
193 |
|
|
my $card_type;
|
194 |
|
|
my $card_file_name;
|
195 |
|
|
my $card_dir_name;
|
196 |
|
|
my $card_vendor;
|
197 |
|
|
my $card_library;
|
198 |
|
|
my $card_component;
|
199 |
|
|
my $card_version;
|
200 |
|
|
|
201 |
|
|
my $parser = XML::LibXML->new();
|
202 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
|
|
|
207 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
208 |
|
|
{
|
209 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
210 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
211 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
212 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
213 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
214 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
215 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
216 |
|
|
if(( $card_type eq "${type}" ) &
|
217 |
|
|
( $card_vendor eq "${vendor}" ) &
|
218 |
|
|
( $card_library eq "${project}" ) &
|
219 |
|
|
( $card_component eq "${component}" ) &
|
220 |
|
|
( $card_version eq "${version}" )
|
221 |
|
|
) {return("${card_file_name}"); }
|
222 |
|
|
}
|
223 |
|
|
}
|
224 |
|
|
|
225 |
|
|
|
226 |
|
|
|
227 |
|
|
#/*********************************************************************************************/
|
228 |
118 |
jt_eaton |
#/ find_ipxact_dir_name */
|
229 |
117 |
jt_eaton |
#/ */
|
230 |
|
|
#/ returns path to ip-xact directory from top level */
|
231 |
118 |
jt_eaton |
#/ my $dir_name = yp::lib::find_ipxact_dir_name($type,$vendor,$library,$component,$version); */
|
232 |
117 |
jt_eaton |
#/ */
|
233 |
|
|
#/*********************************************************************************************/
|
234 |
|
|
|
235 |
118 |
jt_eaton |
sub find_ipxact_dir_name
|
236 |
117 |
jt_eaton |
{
|
237 |
|
|
my @params = @_;
|
238 |
|
|
my $version = pop(@params);
|
239 |
|
|
my $component = pop(@params);
|
240 |
|
|
my $project = pop(@params);
|
241 |
|
|
my $vendor = pop(@params);
|
242 |
|
|
my $type = pop(@params);
|
243 |
|
|
|
244 |
|
|
|
245 |
|
|
my $card_type;
|
246 |
|
|
my $card_file_name;
|
247 |
|
|
my $card_dir_name;
|
248 |
|
|
my $card_vendor_path;
|
249 |
|
|
my $card_library_path;
|
250 |
|
|
my $card_component_path;
|
251 |
|
|
my $card_vendor;
|
252 |
|
|
my $card_library;
|
253 |
|
|
my $card_component;
|
254 |
|
|
my $card_version;
|
255 |
|
|
|
256 |
|
|
my $parser = XML::LibXML->new();
|
257 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
258 |
|
|
|
259 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
260 |
|
|
{
|
261 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
262 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
263 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
264 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
265 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
266 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
267 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
268 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
269 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
270 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
271 |
|
|
if(( $card_type eq "${type}" ) &
|
272 |
|
|
( $card_vendor eq "${vendor}" ) &
|
273 |
|
|
( $card_library eq "${project}" ) &
|
274 |
|
|
( $card_component eq "${component}" ) &
|
275 |
|
|
( $card_version eq "${version}" )
|
276 |
|
|
)
|
277 |
|
|
|
278 |
|
|
{return("${card_dir_name}"); }
|
279 |
|
|
}
|
280 |
|
|
}
|
281 |
|
|
|
282 |
|
|
|
283 |
|
|
|
284 |
|
|
|
285 |
|
|
|
286 |
|
|
|
287 |
|
|
|
288 |
|
|
|
289 |
|
|
#/*********************************************************************************************/
|
290 |
|
|
#/ find_ipxact_vendor_path */
|
291 |
|
|
#/ */
|
292 |
|
|
#/ returns path to ip-xact directory from vendor level */
|
293 |
|
|
#/ The ip-xact file MUST be stored under a subdirectory that matches the vendor name */
|
294 |
118 |
jt_eaton |
#/ my $vendor_path = yp::lib::find_ipxact_vendor_path($type,$vendor,$library,$component,$version); */
|
295 |
117 |
jt_eaton |
#/ */
|
296 |
|
|
#/*********************************************************************************************/
|
297 |
|
|
|
298 |
|
|
sub find_ipxact_vendor_path
|
299 |
|
|
{
|
300 |
|
|
my @params = @_;
|
301 |
|
|
my $version = pop(@params);
|
302 |
|
|
my $component = pop(@params);
|
303 |
|
|
my $project = pop(@params);
|
304 |
|
|
my $vendor = pop(@params);
|
305 |
|
|
my $type = pop(@params);
|
306 |
|
|
|
307 |
|
|
|
308 |
|
|
my $card_type;
|
309 |
|
|
my $card_file_name;
|
310 |
|
|
my $card_dir_name;
|
311 |
|
|
my $card_vendor_path;
|
312 |
|
|
my $card_library_path;
|
313 |
|
|
my $card_component_path;
|
314 |
|
|
my $card_vendor;
|
315 |
|
|
my $card_library;
|
316 |
|
|
my $card_component;
|
317 |
|
|
my $card_version;
|
318 |
|
|
|
319 |
|
|
my $parser = XML::LibXML->new();
|
320 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
321 |
|
|
|
322 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
323 |
|
|
{
|
324 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
325 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
326 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
327 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
328 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
329 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
330 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
331 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
332 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
333 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
334 |
|
|
if(( $card_type eq "${type}" ) &
|
335 |
|
|
( $card_vendor eq "${vendor}" ) &
|
336 |
|
|
( $card_library eq "${project}" ) &
|
337 |
|
|
( $card_component eq "${component}" ) &
|
338 |
|
|
( $card_version eq "${version}" )
|
339 |
|
|
)
|
340 |
|
|
|
341 |
|
|
{return("/${card_vendor_path}"); }
|
342 |
|
|
}
|
343 |
|
|
}
|
344 |
|
|
|
345 |
|
|
|
346 |
|
|
|
347 |
|
|
|
348 |
|
|
#/*********************************************************************************************/
|
349 |
|
|
#/ find_ipxact_library_path */
|
350 |
|
|
#/ */
|
351 |
|
|
#/ returns path to ip-xact directory from library level */
|
352 |
|
|
#/ The ip-xact file MUST be stored under a subdirectory that matches the library name */
|
353 |
118 |
jt_eaton |
#/ my $library_path = yp::lib::find_ipxact_library_path($type,$vendor,$library,$component,$version); */
|
354 |
117 |
jt_eaton |
#/ */
|
355 |
|
|
#/*********************************************************************************************/
|
356 |
|
|
|
357 |
|
|
sub find_ipxact_library_path
|
358 |
|
|
{
|
359 |
|
|
my @params = @_;
|
360 |
|
|
my $version = pop(@params);
|
361 |
|
|
my $component = pop(@params);
|
362 |
|
|
my $project = pop(@params);
|
363 |
|
|
my $vendor = pop(@params);
|
364 |
|
|
my $type = pop(@params);
|
365 |
|
|
|
366 |
|
|
|
367 |
|
|
my $card_type;
|
368 |
|
|
my $card_file_name;
|
369 |
|
|
my $card_dir_name;
|
370 |
|
|
my $card_vendor_path;
|
371 |
|
|
my $card_library_path;
|
372 |
|
|
my $card_component_path;
|
373 |
|
|
my $card_vendor;
|
374 |
|
|
my $card_library;
|
375 |
|
|
my $card_component;
|
376 |
|
|
my $card_version;
|
377 |
|
|
|
378 |
|
|
my $parser = XML::LibXML->new();
|
379 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
380 |
|
|
|
381 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
382 |
|
|
{
|
383 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
384 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
385 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
386 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
387 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
388 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
389 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
390 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
391 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
392 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
393 |
|
|
if(( $card_type eq "${type}" ) &
|
394 |
|
|
( $card_vendor eq "${vendor}" ) &
|
395 |
|
|
( $card_library eq "${project}" ) &
|
396 |
|
|
( $card_component eq "${component}" ) &
|
397 |
|
|
( $card_version eq "${version}" )
|
398 |
|
|
)
|
399 |
|
|
|
400 |
|
|
{return("/${card_library_path}"); }
|
401 |
|
|
}
|
402 |
|
|
}
|
403 |
|
|
|
404 |
|
|
|
405 |
|
|
#/*********************************************************************************************/
|
406 |
|
|
#/ find_ipxact_component_path */
|
407 |
|
|
#/ */
|
408 |
|
|
#/ returns path to ip-xact directory from component level */
|
409 |
|
|
#/ The ip-xact file MUST be stored under a subdirectory that matches the component name */
|
410 |
118 |
jt_eaton |
#/ my $component_path = yp::lib::find_ipxact_component_path($type,$vendor,$library,$component,$version); */
|
411 |
117 |
jt_eaton |
#/ */
|
412 |
|
|
#/*********************************************************************************************/
|
413 |
|
|
|
414 |
|
|
sub find_ipxact_component_path
|
415 |
|
|
{
|
416 |
|
|
my @params = @_;
|
417 |
|
|
my $version = pop(@params);
|
418 |
|
|
my $component = pop(@params);
|
419 |
|
|
my $project = pop(@params);
|
420 |
|
|
my $vendor = pop(@params);
|
421 |
|
|
my $type = pop(@params);
|
422 |
|
|
|
423 |
|
|
|
424 |
|
|
my $card_type;
|
425 |
|
|
my $card_file_name;
|
426 |
|
|
my $card_dir_name;
|
427 |
|
|
my $card_vendor_path;
|
428 |
|
|
my $card_library_path;
|
429 |
|
|
my $card_component_path;
|
430 |
|
|
my $card_vendor;
|
431 |
|
|
my $card_library;
|
432 |
|
|
my $card_component;
|
433 |
|
|
my $card_version;
|
434 |
|
|
|
435 |
|
|
my $parser = XML::LibXML->new();
|
436 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
437 |
|
|
|
438 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
439 |
|
|
{
|
440 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
441 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
442 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
443 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
444 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
445 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
446 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
447 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
448 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
449 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
450 |
|
|
if(( $card_type eq "${type}" ) &
|
451 |
|
|
( $card_vendor eq "${vendor}" ) &
|
452 |
|
|
( $card_library eq "${project}" ) &
|
453 |
|
|
( $card_component eq "${component}" ) &
|
454 |
|
|
( $card_version eq "${version}" )
|
455 |
|
|
)
|
456 |
|
|
|
457 |
|
|
{return("/${card_component_path}"); }
|
458 |
|
|
}
|
459 |
|
|
}
|
460 |
|
|
|
461 |
|
|
|
462 |
|
|
|
463 |
|
|
|
464 |
120 |
jt_eaton |
|
465 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
466 |
|
|
#/ find_lib_comp_sep */
|
467 |
|
|
#/ */
|
468 |
|
|
#/ returns path to the component from library level */
|
469 |
|
|
#/ The file MUST be stored under a subdirectory that matches the component name */
|
470 |
118 |
jt_eaton |
#/ my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library); */
|
471 |
117 |
jt_eaton |
#/ */
|
472 |
|
|
#/*********************************************************************************************/
|
473 |
|
|
|
474 |
|
|
sub find_lib_comp_sep
|
475 |
|
|
{
|
476 |
|
|
my @params = @_;
|
477 |
|
|
my $project = pop(@params);
|
478 |
|
|
my $vendor = pop(@params);
|
479 |
|
|
|
480 |
|
|
|
481 |
|
|
|
482 |
|
|
my $card_type;
|
483 |
|
|
my $card_file_name;
|
484 |
|
|
my $card_dir_name;
|
485 |
|
|
my $card_vendor_path;
|
486 |
|
|
my $card_library_path;
|
487 |
|
|
my $card_component_path;
|
488 |
|
|
my $card_lib_comp_sep;
|
489 |
120 |
jt_eaton |
my $card_lib_ip_dir;
|
490 |
117 |
jt_eaton |
my $card_vendor;
|
491 |
|
|
my $card_library;
|
492 |
|
|
my $card_component;
|
493 |
|
|
my $card_version;
|
494 |
|
|
|
495 |
|
|
my $parser = XML::LibXML->new();
|
496 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
497 |
|
|
|
498 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
499 |
|
|
{
|
500 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
501 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
502 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
503 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
504 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
505 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
506 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
507 |
120 |
jt_eaton |
$card_lib_ip_dir = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
|
508 |
117 |
jt_eaton |
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
509 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
510 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
511 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
512 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
513 |
120 |
jt_eaton |
( $card_library eq "${project}" ) &
|
514 |
|
|
( $card_type eq "socgen:lib" )
|
515 |
117 |
jt_eaton |
)
|
516 |
|
|
{
|
517 |
120 |
jt_eaton |
if($card_lib_ip_dir) {return("/${card_lib_ip_dir}");}
|
518 |
117 |
jt_eaton |
else {return("");}
|
519 |
120 |
jt_eaton |
}
|
520 |
|
|
}
|
521 |
|
|
}
|
522 |
117 |
jt_eaton |
|
523 |
120 |
jt_eaton |
|
524 |
|
|
|
525 |
|
|
|
526 |
|
|
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
|
530 |
|
|
#/*********************************************************************************************/
|
531 |
|
|
#/ find_file_type */
|
532 |
|
|
#/ */
|
533 |
|
|
#/ returns file_type */
|
534 |
|
|
#/ The file MUST be stored under a subdirectory that matches the component name */
|
535 |
|
|
#/ my $file_type = yp::lib::find_file_type($vendor,$library,$component,$version); */
|
536 |
|
|
#/ */
|
537 |
|
|
#/*********************************************************************************************/
|
538 |
|
|
|
539 |
|
|
sub find_file_type
|
540 |
|
|
{
|
541 |
|
|
my @params = @_;
|
542 |
|
|
my $version = pop(@params);
|
543 |
|
|
my $component = pop(@params);
|
544 |
|
|
my $project = pop(@params);
|
545 |
|
|
my $vendor = pop(@params);
|
546 |
|
|
|
547 |
|
|
|
548 |
|
|
|
549 |
|
|
my $card_type;
|
550 |
|
|
my $card_file_name;
|
551 |
|
|
my $card_dir_name;
|
552 |
|
|
my $card_vendor_path;
|
553 |
|
|
my $card_library_path;
|
554 |
|
|
my $card_component_path;
|
555 |
|
|
my $card_lib_comp_sep;
|
556 |
|
|
my $card_vendor;
|
557 |
|
|
my $card_library;
|
558 |
|
|
my $card_component;
|
559 |
|
|
my $card_version;
|
560 |
|
|
|
561 |
|
|
my $parser = XML::LibXML->new();
|
562 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
563 |
|
|
|
564 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
565 |
|
|
{
|
566 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
567 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
568 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
569 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
570 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
571 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
572 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
573 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
574 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
575 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
576 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
577 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
578 |
|
|
( $card_library eq "${project}" ) &
|
579 |
|
|
( $card_component eq "${component}" ) &
|
580 |
|
|
( $card_version eq "${version}" )
|
581 |
|
|
)
|
582 |
|
|
{
|
583 |
|
|
if($card_type) {return("${card_type}");}
|
584 |
|
|
else {return("xxxx");}
|
585 |
117 |
jt_eaton |
}
|
586 |
120 |
jt_eaton |
}
|
587 |
|
|
}
|
588 |
117 |
jt_eaton |
|
589 |
|
|
|
590 |
|
|
|
591 |
|
|
|
592 |
120 |
jt_eaton |
#/*********************************************************************************************/
|
593 |
|
|
#/ find_lib_ip_dir */
|
594 |
|
|
#/ */
|
595 |
|
|
#/ returns library ip directory */
|
596 |
|
|
#/ */
|
597 |
|
|
#/ my $file_lib_ip_dir = yp::lib::find_file_lib_ip_dir($vendor,$library); */
|
598 |
|
|
#/ */
|
599 |
|
|
#/*********************************************************************************************/
|
600 |
|
|
|
601 |
|
|
sub find_lib_ip_dir
|
602 |
|
|
{
|
603 |
|
|
my @params = @_;
|
604 |
|
|
my $project = pop(@params);
|
605 |
|
|
my $vendor = pop(@params);
|
606 |
|
|
|
607 |
|
|
my $card_type;
|
608 |
|
|
my $card_file_name;
|
609 |
|
|
my $card_dir_name;
|
610 |
|
|
my $card_vendor_path;
|
611 |
|
|
my $card_library_path;
|
612 |
|
|
my $card_component_path;
|
613 |
|
|
my $card_lib_comp_sep;
|
614 |
|
|
my $card_vendor;
|
615 |
|
|
my $card_library;
|
616 |
|
|
my $card_component;
|
617 |
|
|
my $card_version;
|
618 |
|
|
my $card_lib_ip_dir;
|
619 |
|
|
my $card_lib_sw_dir;
|
620 |
|
|
|
621 |
|
|
my $parser = XML::LibXML->new();
|
622 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
623 |
|
|
|
624 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
625 |
|
|
{
|
626 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
627 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
628 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
629 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
630 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
631 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
632 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
633 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
634 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
635 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
636 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
637 |
|
|
$card_lib_ip_dir = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
|
638 |
|
|
$card_lib_sw_dir = $index_card->findnodes('../lib_sw_dir/text()')->to_literal ;
|
639 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
640 |
|
|
( $card_library eq "${project}" )
|
641 |
|
|
)
|
642 |
|
|
{
|
643 |
|
|
return("${card_lib_ip_dir}");
|
644 |
|
|
|
645 |
|
|
}
|
646 |
117 |
jt_eaton |
}
|
647 |
|
|
}
|
648 |
|
|
|
649 |
|
|
|
650 |
|
|
|
651 |
120 |
jt_eaton |
#/*********************************************************************************************/
|
652 |
|
|
#/ find_lib_sw_dir */
|
653 |
|
|
#/ */
|
654 |
|
|
#/ returns library sw directory */
|
655 |
|
|
#/ */
|
656 |
|
|
#/ my $file_lib_sw_dir = yp::lib::find_file_lib_sw_dir($vendor,$library); */
|
657 |
|
|
#/ */
|
658 |
|
|
#/*********************************************************************************************/
|
659 |
117 |
jt_eaton |
|
660 |
120 |
jt_eaton |
sub find_lib_sw_dir
|
661 |
|
|
{
|
662 |
|
|
my @params = @_;
|
663 |
|
|
my $project = pop(@params);
|
664 |
|
|
my $vendor = pop(@params);
|
665 |
117 |
jt_eaton |
|
666 |
120 |
jt_eaton |
my $card_type;
|
667 |
|
|
my $card_file_name;
|
668 |
|
|
my $card_dir_name;
|
669 |
|
|
my $card_vendor_path;
|
670 |
|
|
my $card_library_path;
|
671 |
|
|
my $card_component_path;
|
672 |
|
|
my $card_lib_comp_sep;
|
673 |
|
|
my $card_vendor;
|
674 |
|
|
my $card_library;
|
675 |
|
|
my $card_component;
|
676 |
|
|
my $card_version;
|
677 |
|
|
my $card_lib_ip_dir;
|
678 |
|
|
my $card_lib_sw_dir;
|
679 |
|
|
|
680 |
|
|
my $parser = XML::LibXML->new();
|
681 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
682 |
118 |
jt_eaton |
|
683 |
120 |
jt_eaton |
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
684 |
|
|
{
|
685 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
686 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
687 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
688 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
689 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
690 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
691 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
692 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
693 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
694 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
695 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
696 |
|
|
$card_lib_ip_dir = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
|
697 |
|
|
$card_lib_sw_dir = $index_card->findnodes('../lib_sw_dir/text()')->to_literal ;
|
698 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
699 |
|
|
( $card_library eq "${project}" ) &
|
700 |
|
|
( $card_type eq "socgen:lib" )
|
701 |
|
|
)
|
702 |
|
|
{
|
703 |
|
|
if($card_lib_sw_dir){return("/${card_lib_sw_dir}");}
|
704 |
|
|
}
|
705 |
|
|
}
|
706 |
|
|
}
|
707 |
|
|
|
708 |
|
|
|
709 |
|
|
|
710 |
|
|
|
711 |
|
|
|
712 |
|
|
|
713 |
|
|
|
714 |
|
|
|
715 |
|
|
|
716 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
717 |
|
|
#/ find_vendors */
|
718 |
|
|
#/ */
|
719 |
|
|
#/ returns array of all vendors */
|
720 |
|
|
#/ */
|
721 |
118 |
jt_eaton |
#/ my @vendors = yp::lib::find_vendors($type); */
|
722 |
117 |
jt_eaton |
#/ */
|
723 |
|
|
#/*********************************************************************************************/
|
724 |
|
|
|
725 |
|
|
sub find_vendors
|
726 |
|
|
{
|
727 |
|
|
my @params = @_;
|
728 |
|
|
my $type = pop(@params);
|
729 |
|
|
my $card_type;
|
730 |
|
|
my $card_file_name;
|
731 |
|
|
my $card_dir_name;
|
732 |
|
|
my $card_vendor_path;
|
733 |
|
|
my $card_library_path;
|
734 |
|
|
my $card_component_path;
|
735 |
|
|
my $card_lib_comp_sep;
|
736 |
|
|
my $card_vendor;
|
737 |
|
|
my $card_library;
|
738 |
|
|
my $card_component;
|
739 |
|
|
my $card_version;
|
740 |
|
|
|
741 |
|
|
my $parser = XML::LibXML->new();
|
742 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
743 |
|
|
my @vendors = ();
|
744 |
|
|
|
745 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
746 |
|
|
{
|
747 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
748 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
749 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
750 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
751 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
752 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
753 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
754 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
755 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
756 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
757 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
758 |
|
|
|
759 |
|
|
if($card_type eq $type){
|
760 |
|
|
push (@vendors,$card_vendor );
|
761 |
|
|
}
|
762 |
|
|
|
763 |
|
|
}
|
764 |
|
|
@vendors = trim_sort(@vendors);
|
765 |
|
|
return (@vendors);
|
766 |
|
|
}
|
767 |
|
|
|
768 |
|
|
|
769 |
|
|
|
770 |
|
|
#/*********************************************************************************************/
|
771 |
|
|
#/ find_libraries */
|
772 |
|
|
#/ */
|
773 |
|
|
#/ returns array of all libraries from a vendor */
|
774 |
|
|
#/ */
|
775 |
118 |
jt_eaton |
#/ my @libraries = yp::lib::find_libraries($type,$vendor); */
|
776 |
117 |
jt_eaton |
#/ */
|
777 |
|
|
#/*********************************************************************************************/
|
778 |
|
|
|
779 |
|
|
sub find_libraries
|
780 |
|
|
{
|
781 |
|
|
my @params = @_;
|
782 |
|
|
my $vendor = pop(@params);
|
783 |
|
|
my $type = pop(@params);
|
784 |
|
|
my $card_type;
|
785 |
|
|
my $card_file_name;
|
786 |
|
|
my $card_dir_name;
|
787 |
|
|
my $card_vendor_path;
|
788 |
|
|
my $card_library_path;
|
789 |
|
|
my $card_component_path;
|
790 |
|
|
my $card_lib_comp_sep;
|
791 |
|
|
my $card_vendor;
|
792 |
|
|
my $card_library;
|
793 |
|
|
my $card_component;
|
794 |
|
|
my $card_version;
|
795 |
|
|
|
796 |
|
|
my $parser = XML::LibXML->new();
|
797 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
798 |
|
|
my @libraries = ();
|
799 |
|
|
|
800 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
801 |
|
|
{
|
802 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
803 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
804 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
805 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
806 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
807 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
808 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
809 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
810 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
811 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
812 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
813 |
|
|
if(($card_type eq $type)& ($card_vendor eq $vendor)) {
|
814 |
|
|
push (@libraries,$card_library );}
|
815 |
|
|
}
|
816 |
|
|
@libraries = trim_sort(@libraries);
|
817 |
|
|
return (@libraries);
|
818 |
|
|
}
|
819 |
|
|
|
820 |
|
|
|
821 |
|
|
#/*********************************************************************************************/
|
822 |
|
|
#/ find_components */
|
823 |
|
|
#/ */
|
824 |
|
|
#/ returns array of all components from a vendors library */
|
825 |
|
|
#/ */
|
826 |
118 |
jt_eaton |
#/ my @components = yp::lib::find_components($type,$vendor,$library); */
|
827 |
117 |
jt_eaton |
#/ */
|
828 |
|
|
#/*********************************************************************************************/
|
829 |
|
|
|
830 |
|
|
sub find_components
|
831 |
|
|
{
|
832 |
|
|
my @params = @_;
|
833 |
|
|
my $library = pop(@params);
|
834 |
|
|
my $vendor = pop(@params);
|
835 |
|
|
my $type = pop(@params);
|
836 |
|
|
|
837 |
|
|
my $card_type;
|
838 |
|
|
my $card_file_name;
|
839 |
|
|
my $card_dir_name;
|
840 |
|
|
my $card_vendor_path;
|
841 |
|
|
my $card_library_path;
|
842 |
|
|
my $card_component_path;
|
843 |
|
|
my $card_lib_comp_sep;
|
844 |
|
|
my $card_vendor;
|
845 |
|
|
my $card_library;
|
846 |
|
|
my $card_component;
|
847 |
|
|
my $card_version;
|
848 |
|
|
|
849 |
|
|
my $parser = XML::LibXML->new();
|
850 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
851 |
|
|
my @components = ();
|
852 |
|
|
|
853 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
854 |
|
|
{
|
855 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
856 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
857 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
858 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
859 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
860 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
861 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
862 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
863 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
864 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
865 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
866 |
|
|
if(($card_type eq $type) & ($card_vendor eq $vendor) & ($card_library eq $library))
|
867 |
|
|
|
868 |
|
|
{
|
869 |
|
|
push (@components,$card_component);}
|
870 |
|
|
}
|
871 |
|
|
@components = trim_sort(@components);
|
872 |
|
|
return (@components);
|
873 |
|
|
}
|
874 |
|
|
|
875 |
|
|
|
876 |
|
|
|
877 |
|
|
|
878 |
|
|
#/*********************************************************************************************/
|
879 |
|
|
#/ find_versions */
|
880 |
|
|
#/ */
|
881 |
|
|
#/ returns array of all versions from a vendors library component */
|
882 |
|
|
#/ */
|
883 |
118 |
jt_eaton |
#/ my @versions = yp::lib::find_versions($type,$vendor,$library,component); */
|
884 |
117 |
jt_eaton |
#/ */
|
885 |
|
|
#/*********************************************************************************************/
|
886 |
|
|
|
887 |
|
|
sub find_versions
|
888 |
|
|
{
|
889 |
|
|
my @params = @_;
|
890 |
|
|
my $component = pop(@params);
|
891 |
|
|
my $library = pop(@params);
|
892 |
|
|
my $vendor = pop(@params);
|
893 |
|
|
my $type = pop(@params);
|
894 |
|
|
|
895 |
|
|
my $card_type;
|
896 |
|
|
my $card_file_name;
|
897 |
|
|
my $card_dir_name;
|
898 |
|
|
my $card_vendor_path;
|
899 |
|
|
my $card_library_path;
|
900 |
|
|
my $card_component_path;
|
901 |
|
|
my $card_lib_comp_sep;
|
902 |
|
|
my $card_vendor;
|
903 |
|
|
my $card_library;
|
904 |
|
|
my $card_component;
|
905 |
|
|
my $card_version;
|
906 |
|
|
|
907 |
|
|
my $parser = XML::LibXML->new();
|
908 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
909 |
|
|
my @versions = ();
|
910 |
|
|
|
911 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
912 |
|
|
{
|
913 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
914 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
915 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
916 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
917 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
918 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
919 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
920 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
921 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
922 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
923 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
924 |
|
|
if(($card_type eq $type) & ($card_vendor eq $vendor) & ($card_library eq $library) & ($card_component eq $component))
|
925 |
|
|
|
926 |
|
|
{
|
927 |
|
|
push (@versions,$card_version);}
|
928 |
|
|
}
|
929 |
|
|
@versions = trim_sort(@versions);
|
930 |
|
|
return (@versions);
|
931 |
|
|
}
|
932 |
|
|
|
933 |
|
|
|
934 |
|
|
|
935 |
|
|
|
936 |
|
|
|
937 |
|
|
|
938 |
|
|
|
939 |
|
|
|
940 |
|
|
#/*********************************************************************************************/
|
941 |
|
|
#/ find_socgen */
|
942 |
|
|
#/ */
|
943 |
|
|
#/ returns full path name to socgen file */
|
944 |
|
|
#/ */
|
945 |
118 |
jt_eaton |
#/ my $socgen_ip_file = yp::lib::find_socgen($type,$vendor,$library,$component); */
|
946 |
117 |
jt_eaton |
#/ */
|
947 |
|
|
#/*********************************************************************************************/
|
948 |
|
|
|
949 |
|
|
sub find_socgen
|
950 |
|
|
{
|
951 |
|
|
my @params = @_;
|
952 |
|
|
my $component = pop(@params);
|
953 |
|
|
my $project = pop(@params);
|
954 |
|
|
my $vendor = pop(@params);
|
955 |
|
|
my $type = pop(@params);
|
956 |
|
|
|
957 |
|
|
|
958 |
|
|
my $card_type;
|
959 |
|
|
my $card_file_name;
|
960 |
|
|
my $card_dir_name;
|
961 |
|
|
my $card_vendor;
|
962 |
|
|
my $card_library;
|
963 |
|
|
my $card_component;
|
964 |
|
|
|
965 |
|
|
my $parser = XML::LibXML->new();
|
966 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
967 |
|
|
|
968 |
|
|
|
969 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
970 |
|
|
{
|
971 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
972 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
973 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
974 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
975 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
976 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
977 |
|
|
if(( $card_type eq "${type}" ) &
|
978 |
|
|
( $card_vendor eq "${vendor}" ) &
|
979 |
|
|
( $card_library eq "${project}" ) &
|
980 |
|
|
( $card_component eq "${component}" )
|
981 |
|
|
) {return("./${card_dir_name}/${card_file_name}"); }
|
982 |
|
|
}
|
983 |
|
|
}
|
984 |
|
|
|
985 |
|
|
|
986 |
|
|
|
987 |
|
|
|
988 |
|
|
sub trim_sort {
|
989 |
|
|
my @output_files = @_;
|
990 |
|
|
my %trim = ();
|
991 |
|
|
foreach my $descriptor (@output_files) { $trim{$descriptor} = 1; }
|
992 |
|
|
my @k = keys %trim;
|
993 |
|
|
@output_files = sort(sort @k);
|
994 |
|
|
return(@output_files);
|
995 |
|
|
}
|
996 |
|
|
|
997 |
|
|
|
998 |
|
|
|
999 |
|
|
|
1000 |
|
|
1;
|