8ac5e011d6
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
32 lines
643 B
Perl
32 lines
643 B
Perl
#! @perl@ -w
|
|
|
|
use strict;
|
|
|
|
my @paths = split ' ', $ENV{"ALL_INPUTS"};
|
|
|
|
open IN, "<$ARGV[0]" or die;
|
|
open OUT, ">$ARGV[0].tmp" or die;
|
|
|
|
while (<IN>) {
|
|
# !!! should use a real XML library here.
|
|
if (!/<dllmap dll="(.*)" target="(.*)"\/>/) {
|
|
print OUT;
|
|
next;
|
|
}
|
|
my $dll = $1;
|
|
my $target = $2;
|
|
|
|
foreach my $path (@paths) {
|
|
my $fullPath = "$path/lib/$target";
|
|
if (-e "$fullPath") {
|
|
$target = $fullPath;
|
|
last;
|
|
}
|
|
}
|
|
|
|
print OUT " <dllmap dll=\"$dll\" target=\"$target\"/>\n";
|
|
}
|
|
|
|
close IN;
|
|
|
|
rename "$ARGV[0].tmp", "$ARGV[0]" or die "cannot rename $ARGV[0]";
|