[BACK]Return to find_depends CVS log [TXT][DIR] Up to [local] / openbsd / fill_chroot

File: [local] / openbsd / fill_chroot / find_depends (download)

Revision 1.13, Tue Sep 30 20:54:01 2008 UTC (15 years, 7 months ago) by andrew
Branch: MAIN
Changes since 1.12: +20 -143 lines

much simpler find_depends that is written as a shell script.

#!/bin/sh
# $RedRiver$

find_depends() {
    local _file="$1"
    local _line

    test -z "$_file" && continue

    /usr/bin/ldd "$_file" | awk '$7 ~ /^\// { print $7 }' | {
        while read _line; do
            test -z "$_line"            && continue
            echo $_line

            test X"$_file" == X"$_line" && continue
            find_depends "$_line"
        done
    }
}

{
    for f in  "$@"; do
        find_depends "$f" 
    done
} | sort -u