]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
update, and don't process files repeatedly.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 20 Oct 2021 13:46:41 +0000 (09:46 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 Oct 2021 14:57:53 +0000 (10:57 -0400)
scripts/build/min-includes.pl

index 9f0d7a358bae419f378e375757989ca34909dd25..1ca75b41e60acf0da0d46d4be84f6673a2612eb3 100755 (executable)
@@ -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;