perl/checkemptydirs
Petr Písař 46308c06eb Own upper directories by each package and remove empty directories
Standard @INC directories are exceptions.
"machine" directory has unknown origin but comes from upstream. Lets
keep it there now.
2014-11-20 15:57:29 +01:00

12 lines
320 B
Bash
Executable File

#!/bin/bash
for P in "$@"; do
echo "Empty directories in RPM package $P:"
for D in $(rpm -qlvp "$P" | \
perl -ne \
'if (/\Adrwx/) {$n=${[split /\s+/]}[8]; print qq{$n\n}}' | \
sort -f); do
test $(rpm -qlp "$P" | grep -c -F "$D/") == 0 && echo "$D";
done
done