Skip to content

Commit

Permalink
Avoid duplication in make_standalone with multiple encoders
Browse files Browse the repository at this point in the history
This corrects a problem in the recent 6d673f6 (Extend make_standalone
script to allow for more than 1 encoder, 2021-02-12) which could (and
did) result in having duplicated dependencies in the generated files.
While this didn't seem to result in any problems, it is still at best
completely unnecessary.

Keep track of the dependencies we had already seen to prevent this from
happening.
  • Loading branch information
vadz authored and terryburton committed Feb 13, 2021
1 parent 6d673f6 commit a8ebb7a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build/make_standalone
Expand Up @@ -39,6 +39,8 @@ close(PS);

open(PS,">$outfile") || die "Failed to write $outfile";
print PS $head;

my %seen;
for my $encoder (@encoders) {
($_,$_,my $meta,$_)=$template=~/
^%\ --BEGIN\ (ENCODER|RENDERER|RESOURCE)\ ($encoder)--$
Expand All @@ -63,6 +65,7 @@ for my $encoder (@encoders) {
my $dsc=$4;
my $body=$5;
next unless $reqs{$resource};
next if $seen{$resource}++;
print PS "$dsc$body\n";
}
}
Expand Down

0 comments on commit a8ebb7a

Please sign in to comment.