git://git.jankratochvil.net
/
nethome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7a08c1d
)
rpmsafereduce: Fix missing: /usr/local
author
root
<jan.kratochvil@redhat.com>
Thu, 16 Jul 2020 20:18:15 +0000
(22:18 +0200)
committer
root
<jan.kratochvil@redhat.com>
Thu, 16 Jul 2020 20:18:15 +0000
(22:18 +0200)
bin/rpmsafereduce
patch
|
blob
|
history
diff --git
a/bin/rpmsafereduce
b/bin/rpmsafereduce
index
5a7922c
..
71d2685
100755
(executable)
--- a/
bin/rpmsafereduce
+++ b/
bin/rpmsafereduce
@@
-23,13
+23,14
@@
while (<>) {
carp "sort -u: $l >= $_" if $l && $l ge $_;
$l=$_;
my $sl=slashes $_;
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;
$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=();
while (%t) {
my @t=keys(%t);
%t=();
@@
-41,6
+42,7
@@
while (%t) {
print STDERR (@t+0)." \r";
}
my $t=shift @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;
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: $!";
last;
}
closedir DIR or carp "$t: $!";
- next if !$ok;
+ if (!$ok) {
+ do { $b{$t}=1; } while $t=~s{/[^/]*$}{};
+ next;
+ }
for my $d (@d) {
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;
}
$f{$t}=slashes $t;
$t=~s{/[^/]*$}{} or carp $t;
@@
-68,5
+72,5
@@
while (%t) {
}
}
for my $f (sort keys(%f)) {
}
}
for my $f (sort keys(%f)) {
- print "$f\n";
+ print "$f\n"
if !$b{$f}
;
}
}