devtools/finddeps.in

41 lines
938 B
Plaintext
Raw Normal View History

#!/bin/bash
#
# finddeps - find packages that depend on a given depname
#
match=$1
tld=$(pwd)
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
for d in "$(find . -type d)"; do
cd "$d"
if [[ -f PKGBUILD ]]; then
2010-02-13 19:47:16 +01:00
unset pkgname depends makedepends
. PKGBUILD
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
cd "$tld"
done