tools/filter_obyfile.pl
branchsystem_startup
changeset 41 c57a6c85ccdc
parent 27 c29882e1d694
child 57 a44af1db196f
--- a/tools/filter_obyfile.pl	Thu Oct 14 16:46:13 2010 +0100
+++ b/tools/filter_obyfile.pl	Thu Oct 14 16:46:54 2010 +0100
@@ -264,9 +264,17 @@
 		
 		if (defined $stem_substitutions{$romfile})
 			{
-			# print STDERR "Applying stem_ prefix to $hostfile in $line\n";
-			$hostfile =~ s/(\/|\\)([^\\\/]+)$/$1stem_$2/;
-			$stem_count++;
+			if ($hostfile =~ /^(.*(\/|\\))([^\\\/]+)$/)
+				{
+				my $path=$1;
+				my $filename=$3;
+				if ($filename !~ /^stem_/)
+					{
+					# print STDERR "Applying stem_ prefix to $hostfile in $line\n";
+					$hostfile = "${path}stem_$filename";
+					$stem_count++;
+					}
+				}
 			}
 		print $romcmd, $hostfile, $romfile, $rest, "\n";
 		next;