devtools/finddeps.in

38 lines
929 B
Plaintext
Raw Normal View History

#!/bin/bash
#
# finddeps - find packages that depend on a given depname
#
match=$1
if [[ -z $match ]]; then
2010-02-13 19:47:16 +01:00
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
find . -type d | while read d; do
if [[ -f "$d/PKGBUILD" ]]; then
unset pkgname depends makedepends optdepends
. "$d/PKGBUILD"
2010-02-13 19:47:16 +01:00
for dep in "${depends[@]}"; do
2011-03-13 18:01:20 +01:00
# lose the version comparator, if any
2010-02-13 19:47:16 +01:00
depname=${dep%%[<>=]*}
[[ $depname = $match ]] && echo "$d (depends)"
2010-02-13 19:47:16 +01:00
done
for dep in "${makedepends[@]}"; do
2011-03-13 18:01:20 +01:00
# lose the version comparator, if any
2010-02-13 19:47:16 +01:00
depname=${dep%%[<>=]*}
[[ $depname = $match ]] && echo "$d (makedepends)"
2010-02-13 19:47:16 +01:00
done
for dep in "${optdepends[@]/:*}"; do
# lose the version comaparator, if any
depname=${dep%%[<>=]*}
[[ $depname = $match ]] && echo "$d (optdepends)"
done
2010-02-13 19:47:16 +01:00
fi
done