aboutsummaryrefslogtreecommitdiffstats
path: root/clean_perl
blob: eca5b630dcf8dda12322df60d9d42dd9771fdbb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

d=$RPM_BUILD_ROOT/usr/lib/perl5

[ -d $d ] || exit 0

find $d -name ".packlist" | xargs rm -f

# remove file alike /usr/lib/perl5/5.8.*/i386-linux-thread-multi/perllocal.pod
perl -MConfig -e 'unlink "$ENV{RPM_BUILD_ROOT}$Config{installarchlib}/perllocal.pod"'

for i in $(find $d -name "*.bs"); do
    if [ -s $i ]; then
	echo "non empty .bs file, please mail rgarciasuarez@mandriva.com about this!"
    else
	rm -f $i
    fi
done

find $d -depth -type d -exec rmdir {} 2>/dev/null \;