Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
33 lines
643 B
Perl
33 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]";
|