equal
deleted
inserted
replaced
17 package spitool; |
17 package spitool; |
18 |
18 |
19 use strict; |
19 use strict; |
20 use Exporter; |
20 use Exporter; |
21 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
21 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
|
22 use romutl; |
22 |
23 |
23 $VERSION = 1.00; |
24 $VERSION = 1.00; |
24 @ISA = qw(Exporter); |
25 @ISA = qw(Exporter); |
25 @EXPORT = (); |
26 @EXPORT = (); |
26 @EXPORT_OK = qw(createSpi); |
27 @EXPORT_OK = qw(createSpi); |
169 my @uid2; |
170 my @uid2; |
170 my @uid3; |
171 my @uid3; |
171 my @existingUid = (-1,-1,-1,-1); |
172 my @existingUid = (-1,-1,-1,-1); |
172 my $uidNumber; |
173 my $uidNumber; |
173 my $defaultSpiFileName = "ecom-0-0.spi"; |
174 my $defaultSpiFileName = "ecom-0-0.spi"; |
174 my $defaultTargetDirectory = "$ENV{EPOCROOT}epoc32\\tools\\"; |
175 my $defaultTargetDirectory = &get_epocroot."epoc32\/tools\/"; |
175 my @defaultUid = (-1,-1,-1,-1); |
176 my @defaultUid = (-1,-1,-1,-1); |
176 |
177 |
177 ########################################################################################## |
178 ########################################################################################## |
178 # Reading arguments phase |
179 # Reading arguments phase |
179 ########################################################################################## |
180 ########################################################################################## |
223 push @hideresourceFiles, $file; |
224 push @hideresourceFiles, $file; |
224 } |
225 } |
225 next; |
226 next; |
226 } |
227 } |
227 if (-d $arg) { |
228 if (-d $arg) { |
228 if(($arg =~ m-^.:-) && ($arg =~ m-\\$-)) { |
229 if(($arg =~ m-^.:-) && ($arg =~ m-[\\\/]$-)) { |
229 unless(opendir(DIRECTORY, $arg)) { print "Exiting: $arg"; exit; } |
230 unless(opendir(DIRECTORY, $arg)) { print "Exiting: $arg"; exit; } |
230 while (my $file=readdir(DIRECTORY)) { |
231 while (my $file=readdir(DIRECTORY)) { |
231 my $newfile = $arg.$file; |
232 my $newfile = $arg.$file; |
232 if(!(-d $newfile)) { |
233 if(!(-d $newfile)) { |
233 push @resourceFiles, $newfile; |
234 push @resourceFiles, $newfile; |
315 $filestobehidden[$i] = 1; |
316 $filestobehidden[$i] = 1; |
316 } |
317 } |
317 } |
318 } |
318 |
319 |
319 for(my $i=0;$i<scalar @resourceFiles;$i++) { |
320 for(my $i=0;$i<scalar @resourceFiles;$i++) { |
320 if($resourceFiles[$i]=~m|\\|) { |
321 if($resourceFiles[$i]=~m|\/|) { |
321 if($resourceFiles[$i]=~m|(.*)\\([^\\]*)$|) { |
322 if($resourceFiles[$i]=~m|(.*)\/([^\/]*)$|) { |
322 $resourceFilePaths[$i]=$1; |
323 $resourceFilePaths[$i]=$1; |
323 $resourceFileNames[$i]=$2; |
324 $resourceFileNames[$i]=$2; |
324 } |
325 } |
325 if($resourceFileNames[$i]=~m|(.*)\.([^\.]*)|) { |
326 if($resourceFileNames[$i]=~m|(.*)\.([^\.]*)|) { |
326 $resourceFileNames[$i]= $1; |
327 $resourceFileNames[$i]= $1; |
332 $resourceFileNames[$i]= $1; |
333 $resourceFileNames[$i]= $1; |
333 $resourceExtensions[$i]=$2; |
334 $resourceExtensions[$i]=$2; |
334 } |
335 } |
335 } |
336 } |
336 } |
337 } |
337 |
|
338 my %uid2values; #hash to hold UID2 values for each type of SPI file |
338 my %uid2values; #hash to hold UID2 values for each type of SPI file |
339 $uid2values{"ecom"} = 270556204; |
339 $uid2values{"ecom"} = 270556204; |
340 |
340 |
341 ########################################################## |
341 ########################################################## |
342 # Existing file stage |
342 # Existing file stage |