From: Alan T. DeKok Date: Wed, 20 Oct 2021 13:46:41 +0000 (-0400) Subject: update, and don't process files repeatedly. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfc03a188b4def43ee16522af67846f05e988779;p=thirdparty%2Ffreeradius-server.git update, and don't process files repeatedly. --- diff --git a/scripts/build/min-includes.pl b/scripts/build/min-includes.pl index 9f0d7a358ba..1ca75b41e60 100755 --- a/scripts/build/min-includes.pl +++ b/scripts/build/min-includes.pl @@ -9,10 +9,10 @@ # ###################################################################### # -# Run as: ./min-includes.pl `find . -name "*.c" -print` +# Run as: ./min-includes.pl $(find . -name "*.c" -print) # prints out duplicate includes from files. # -# ./min-includes.pl +n `find . -name "*.c" -print` +# ./min-includes.pl +n $(find . -name "*.c" -print) # removes the duplicate includes from each file. # Remember to check that it still builds! # @@ -56,6 +56,8 @@ my %delete_line; sub process { my $file = shift; + $file =~ s,//,/,g; + return if ($processed{$file}); $processed{$file}++; @@ -126,6 +128,8 @@ foreach my $inc (@work) { $path =~ s:/.*?/\.\.::; next if (! -e $path); + next if $reverse{$path}; + process($path); $forward{$inc} = $path; $reverse{$path} = $inc;