diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-07-01 17:17:25 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-07-01 17:17:25 +0200 |
commit | 8e5427042da3d39e809a7c5eaf8e2b988a3abd0a (patch) | |
tree | d8dd2f81c809112f62c8f01886cbabc055fb1fd3 /find-broken-perl-packages.sh | |
parent | d0f93403ace35b3fa06fdde4f6d007c72fe0808f (diff) | |
download | bin-8e5427042da3d39e809a7c5eaf8e2b988a3abd0a.tar.gz bin-8e5427042da3d39e809a7c5eaf8e2b988a3abd0a.tar.xz |
add find-broken-perl-packages.sh
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'find-broken-perl-packages.sh')
-rwxr-xr-x | find-broken-perl-packages.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/find-broken-perl-packages.sh b/find-broken-perl-packages.sh new file mode 100755 index 0000000..1b09144 --- /dev/null +++ b/find-broken-perl-packages.sh @@ -0,0 +1,21 @@ +#!/bin/bash +perllibpath="/usr/lib/perl5/vendor_perl/auto/" + +tmpdir=$(mktemp -d /tmp/find-broken-perl-package.XXXXXXXX) +find "$perllibpath" -name "*.so" | + sed \ + -e "s|$perllibpath||" \ + -e 's|/|::|g' \ + -e 's|.so$||' \ + -e 's|\(.*\)::.*$|\1|' | + while read module; do + 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 + fi + done + +pacman -Qqo $(<$tmpdir/raw.txt) &> $tmpdir/pacman.txt + +echo "tempdir is \"$tmpdir\"" |