imgtools/buildrom/tools/datadriveimage.pm
changeset 607 378360dbbdba
parent 590 360bd6b35136
parent 606 30b30f9da0b7
child 626 ac03b93ca9c4
equal deleted inserted replaced
591:22486c9c7b15 607:378360dbbdba
   227 		return 0;
   227 		return 0;
   228 	}
   228 	}
   229 	else
   229 	else
   230 	{
   230 	{
   231 		print "$source copied to $destfile\n" if($verboseOpt);
   231 		print "$source copied to $destfile\n" if($verboseOpt);
   232 		return $destfile;
   232 		return "\"".$destfile."\"";
   233 	}
   233 	}
   234 }
   234 }
   235 
   235 
   236 # Make a check for sisfile keyword by reading the specified iby/oby file,
   236 # Make a check for sisfile keyword by reading the specified iby/oby file,
   237 # if sisfile keyword is found then push the respective image on to the respective array 
   237 # if sisfile keyword is found then push the respective image on to the respective array 
   286 {
   286 {
   287 	my($dir,$obyfile,$nonsisFileArray,$renameArray,$aliasArray,$hideArray,$verboseOpt,$keepgoingOpt) = @_;
   287 	my($dir,$obyfile,$nonsisFileArray,$renameArray,$aliasArray,$hideArray,$verboseOpt,$keepgoingOpt) = @_;
   288 	open (OBEY ,$obyfile) or die($obyfile."\n");
   288 	open (OBEY ,$obyfile) or die($obyfile."\n");
   289 	while(my $line =<OBEY>) 
   289 	while(my $line =<OBEY>) 
   290 	{
   290 	{
   291 		if( $line =~ /^(file|data)\s*=\s*(\S+)\s+(\S+)/i )
   291 		if( $line =~ /^(file|data)\s*=\s*(\"[^"]+\")\s+(\"[^"]+\")/i || 
       
   292 				$line =~ /^(file|data)\s*=\s*(\"[^"]+\")\s+(\S+)/i || 
       
   293 				$line =~ /^(file|data)\s*=\s*(\S+)\s+(\"[^"]+\")/i || 
       
   294 				$line =~ /^(file|data)\s*=\s*(\S+)\s+(\S+)/i )
   292 		{
   295 		{
   293 			my $keyWord=$1;
   296 			my $keyWord=$1;
   294 			my $source=$2;
   297 			my $source=$2;
   295 			my $dest=$3;
   298 			my $dest=$3;
   296 
   299 
   297 			if( $source !~ /(\S+):(\S+)/ )
   300 			if( $source !~ /(\S+):([^"]+)/ )
   298 			{ 
   301 			{ 
   299 				$source = get_drive().$2;
   302 				$source = get_drive().$2;
   300 			}
   303 			}
   301 			my $var = &copyFilesToFolders( $source,$dest,$dir,$verboseOpt);
   304 			my $var = &copyFilesToFolders( $source,$dest,$dir,$verboseOpt);
   302 			if($var)
   305 			if($var)
   303 			{
   306 			{
   304 				$var = $keyWord."=".$var;
   307 				$line = $keyWord."=".$var."\t".$dest."\n";
   305 				$line =~ s/^(\S+)=(\S+)/$var/;
       
   306 				push(@$nonsisFileArray,$line);
   308 				push(@$nonsisFileArray,$line);
   307 			}
   309 			}
   308 			else
   310 			else
   309 			{
   311 			{
   310 				exit(1)if(!$keepgoingOpt);
   312 				exit(1)if(!$keepgoingOpt);