summaryrefslogtreecommitdiffstats
path: root/build_tools
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-07-23 01:04:17 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-07-23 01:04:17 (GMT)
commit6e54a21887c398c75babc64dadb4dd83bb6b94bf (patch)
tree7541eed32ac5b31c8ccd30bd2a17e1e6a365f5b2 /build_tools
parentf6ee6136060f0a1253c0b178372a919ac048f81d (diff)
downloadlinhes_dev-6e54a21887c398c75babc64dadb4dd83bb6b94bf.zip
find_deps.sh: add new script to locate packages that depend on any given pkg.
for instance to check for pkgs that need libjpeg in core-testing cd /data/LinHES-PKGBUILD/abs/core-testing find_deps.sh libjpeg ./libmng (depends) ./jasper (depends) ./libwmf (depends) ./pil (depends) ./fbsplash (depends) ./qt3 (depends) ./fltk (depends) ./perl_modules/perl-tk (depends) ./libtiff (depends) ./directfb (depends) ./php (makedepends) ./php (makedepends) ./mjpegtools (depends)
Diffstat (limited to 'build_tools')
-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: