summaryrefslogtreecommitdiffstats
path: root/find-broken-perl-packages.sh
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-05-24 01:24:49 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-05-24 01:24:49 +0200
commitc01b7ef99e28767f0a00a9e39d817d80b8ab2700 (patch)
tree0b9e6e294b3fd06695b7aac7a0e63a30287f3e57 /find-broken-perl-packages.sh
parent54ed0db16461fbb0deef48d5308fa7262f021c3b (diff)
downloadbin-c01b7ef99e28767f0a00a9e39d817d80b8ab2700.tar.gz
bin-c01b7ef99e28767f0a00a9e39d817d80b8ab2700.tar.xz
find-broken-perl-packages: detect perl version mismatch
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'find-broken-perl-packages.sh')
-rwxr-xr-xfind-broken-perl-packages.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/find-broken-perl-packages.sh b/find-broken-perl-packages.sh
index d0aac57..d499868 100755
--- a/find-broken-perl-packages.sh
+++ b/find-broken-perl-packages.sh
@@ -4,16 +4,19 @@ perllibpath="/usr/lib/perl5/vendor_perl/auto/"
tmpdir=$(mktemp -d /tmp/find-broken-perl-package.XXXXXXXX)
touch $tmpdir/{raw,perl-modules}.txt
find "$perllibpath" -name "*.so" |
- sed \
- -e "s|$perllibpath||" \
- -e 's|/|::|g' \
- -e 's|.so$||' \
- -e 's|\(.*\)::.*$|\1|' |
- while read module; do
+ while read file; do
+ module=$(echo $file | sed \
+ -e "s|$perllibpath||" \
+ -e 's|/|::|g' \
+ -e 's|.so$||' \
+ -e 's|\(.*\)::.*$|\1|')
output=$(perl -M$module -e1 2>&1)
if grep -q "perl: symbol lookup error:" <<< $output; then
sed -n 's|perl: symbol lookup error: \(.*\): undefined symbol: .*|\1|p' <<< $output >> $tmpdir/raw.txt
- echo $module >> $tmpdir/perl-modules.txt
+ echo "$module" >> "$tmpdir/perl-modules.txt"
+ elif grep -q "Perl API version .* of .* does not match .*" <<< $output; then
+ echo $file >> $tmpdir/raw.txt
+ echo "$module" >> "$tmpdir/perl-modules.txt"
fi
done