summaryrefslogtreecommitdiff
path: root/autodeps/freebsd.req
diff options
context:
space:
mode:
Diffstat (limited to 'autodeps/freebsd.req')
-rw-r--r--autodeps/freebsd.req22
1 files changed, 22 insertions, 0 deletions
diff --git a/autodeps/freebsd.req b/autodeps/freebsd.req
new file mode 100644
index 0000000..9a1e0f4
--- /dev/null
+++ b/autodeps/freebsd.req
@@ -0,0 +1,22 @@
+#!/bin/sh
+# ----------------------------------------------------------------
+# find-requires for FreeBSD-2.2.x
+# how do we know what is required by a.out shared libraries?
+# ----------------------------------------------------------------
+ulimit -c 0
+
+filelist=`sed "s/['\"]/\\\&/g"`
+exelist=`echo $filelist | xargs file | grep -F executable | cut -d: -f1 `
+scriptlist=`echo $filelist | xargs file | grep -E ":.* (commands|script) " | cut -d: -f1 `
+
+for f in $exelist; do
+ if [ -x $f ]; then
+ ldd $f | /usr/bin/awk '/=>/&&!/not found/ { print $3 }'
+ fi
+done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u
+
+for f in $scriptlist; do
+ if [ -x $f ]; then
+ head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1
+ fi
+done | sort -u