From 7a0e9e3c7deeeca9b62f49ed8570cc7e729f0968 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Jul 2020 22:18:15 +0200 Subject: [PATCH] rpmsafereduce: Fix missing: /usr/local --- bin/rpmsafereduce | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/rpmsafereduce b/bin/rpmsafereduce index 5a7922c..71d2685 100755 --- a/bin/rpmsafereduce +++ b/bin/rpmsafereduce @@ -23,13 +23,14 @@ while (<>) { carp "sort -u: $l >= $_" if $l && $l ge $_; $l=$_; my $sl=slashes $_; - $d{$_}=$sl if -d; + $t{$_}=1,$d{$_}=$sl if -d; $f{$_}=$sl if -f; s{/[^/]*$}{} or carp $_; $d{$_}=$sl-1 if $IGNORE_D && $_ ne ""; $t{$_}=1 if $d{$_}; } my $time; +my(%b); while (%t) { my @t=keys(%t); %t=(); @@ -41,6 +42,7 @@ while (%t) { print STDERR (@t+0)." \r"; } my $t=shift @t; + next if $b{$t}; next if !$d{$t}&&!$f{$t}; opendir DIR,$t or carp "$t: $!"; my $ok=1; @@ -56,10 +58,12 @@ while (%t) { last; } closedir DIR or carp "$t: $!"; - next if !$ok; + if (!$ok) { + do { $b{$t}=1; } while $t=~s{/[^/]*$}{}; + next; + } for my $d (@d) { - delete $f{"$t/$d"}; - delete $t{"$t/$d"}; + $b{"$t/$d"}=1; } $f{$t}=slashes $t; $t=~s{/[^/]*$}{} or carp $t; @@ -68,5 +72,5 @@ while (%t) { } } for my $f (sort keys(%f)) { - print "$f\n"; + print "$f\n" if !$b{$f}; } -- 1.8.3.1