summaryrefslogtreecommitdiffstats
path: root/build_tools/bin
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools/bin')
-rwxr-xr-xbuild_tools/bin/find_deps.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/build_tools/bin/find_deps.sh b/build_tools/bin/find_deps.sh
new file mode 100755
index 0000000..914088c
--- /dev/null
+++ b/build_tools/bin/find_deps.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+if [ "$1" = "" ]; then
+ echo "usage: finddeps <depname>"
+ echo ""
+ echo "Find packages that depend on a given depname."
+ echo "Run this script from the top-level directory of your ABS tree."
+ echo ""
+ exit 0
+fi
+
+match=$1
+tld=$(pwd)
+
+#for d in $(find . -type d ); do
+for d in $(find . -type d ! -path "*/pkg/*" ! -path "*/src/*"); do
+ cd ${d}
+ if [ -f PKGBUILD ]; then
+ unset pkgname depends makedepends
+ . PKGBUILD
+ for dep in "${depends[@]}"; do
+ # lose the version comaparator, if any
+ depname=${dep%%[<>=]*}
+ if [ "$depname" = "$match" ]; then
+ echo "$d (depends)"
+ fi
+ done
+ for dep in "${makedepends[@]}"; do
+ # lose the version comaparator, if any
+ depname=${dep%%[<>=]*}
+ if [ "$depname" = "$match" ]; then
+ echo "$d (makedepends)"
+ fi
+ done
+ fi
+ cd $tld
+done
+
+# vim:ft=sh:ts=4:sw=4:et: