imgtools/buildrom/tools/externaltools.pm
changeset 626 ac03b93ca9c4
parent 590 360bd6b35136
child 706 5221386d044b
--- a/imgtools/buildrom/tools/externaltools.pm	Thu Aug 12 09:00:16 2010 +0100
+++ b/imgtools/buildrom/tools/externaltools.pm	Tue Aug 17 15:31:16 2010 +0800
@@ -85,7 +85,7 @@
 # Called between the buildrom stage to invoke single or multiple invocation
 sub runExternalTool {
 	
-	my ($stageName,$OBYData) = @_;
+	my ($stageName,$OBYData,$workdir) = @_;
 	$stageName = lc $stageName;
 	my @toolInfoList =  @{$invocations{$stageName}}; # Collect Tools with respect to its stagename.
 	
@@ -93,8 +93,8 @@
 		if($tool->{name} eq "configpaging"){
 			my $pid ; 
 			my $args = $tool->{args};
-		
-			open CONFIG, "| configpaging $args >cfgp_out.oby" or die "* Can't execute cpp";
+			my $outputoby = $workdir."cfgp_out.oby";
+			open CONFIG, "| configpaging $args >$outputoby" or die "* Can't execute configpaging";
 	
 			foreach (@$OBYData){
 				chomp ;
@@ -105,13 +105,13 @@
 			close CONFIG;
 	
 			my $config_status = $?;
-			die "* configpaging failed\n" if ($config_status != 0 || !-f "cfgp_out.oby");
+			die "* configpaging failed\n" if ($config_status != 0 || !-f "$outputoby");
 
-			if(open(INTF,"cfgp_out.oby")){
+			if(open(INTF,"$outputoby")){
 				@$OBYData = <INTF>;
 				close INTF;
 			}			
-			unlink("cfgp_out.oby") or die "cannot delete cfgp_out.oby";	
+			unlink("$outputoby") or die "cannot delete $outputoby";	
 			next ;
 		}
 		if (exists($tool->{single})) {#Check if single invocation exists