Ticket #37275: search-oldlibpng.sh

File search-oldlibpng.sh, 679 bytes (added by jmroot (Joshua Root), 11 years ago)
Line 
1#!/bin/sh
2
3files=""
4ports=""
5for f in $(find /opt/local/bin -type f) $(find /opt/local/lib -name \*.dylib); do
6    if [[ ! -L $f ]] && otool -L $f | grep -q 'libpng1[24]'; then
7        files+="\n$f"
8        ports+="\n$(port provides $f | cut -d ' ' -f 5)"
9    fi
10done
11for f in $(find /opt/local/lib -name \*.la); do
12    if grep -q 'libpng1[24]' $f; then
13        files+="\n$f"
14        ports+="\n$(port provides $f | cut -d ' ' -f 5)"
15    fi
16done
17
18if [[ -n "$files" ]]; then
19    echo "Files with old libpng references are:"
20    echo $files
21    echo
22    echo "and are provided by these ports:"
23    echo $ports | sort -u
24else
25    echo "No files with old libpng references found."
26fi