Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 38 lines (34 sloc) 0.929 kb
c229a69 Aaron Griffin Add finddeps script from cvs-arch
phrakture authored
1 #!/bin/bash
f05495d Dan McGee Whitespace fixes/cleanup to all of the scripts
toofishes authored
2 #
3 # finddeps - find packages that depend on a given depname
4 #
c229a69 Aaron Griffin Add finddeps script from cvs-arch
phrakture authored
5
4800be2 finddeps: Proper quoting, use double brackets
Lukas Fleischer authored
6 match=$1
7
8 if [[ -z $match ]]; then
362a99b Pierre Schmitz apply common coding style
pierres authored
9 echo 'usage: finddeps <depname>'
10 echo ''
11 echo 'Find packages that depend on a given depname.'
12 echo 'Run this script from the top-level directory of your ABS tree.'
13 echo ''
14 exit 0
c229a69 Aaron Griffin Add finddeps script from cvs-arch
phrakture authored
15 fi
16
84b789f finddeps: Use read builtin to iterate over packages
Lukas Fleischer authored
17 find . -type d | while read d; do
8edb443 finddeps: Remove redundant cd(1)
Lukas Fleischer authored
18 if [[ -f "$d/PKGBUILD" ]]; then
dcb80e7 finddeps: Unset optdepends
Lukas Fleischer authored
19 unset pkgname depends makedepends optdepends
8edb443 finddeps: Remove redundant cd(1)
Lukas Fleischer authored
20 . "$d/PKGBUILD"
362a99b Pierre Schmitz apply common coding style
pierres authored
21 for dep in "${depends[@]}"; do
ba7cc13 Jan Alexander Steffens Fix spelling
heftig authored
22 # lose the version comparator, if any
362a99b Pierre Schmitz apply common coding style
pierres authored
23 depname=${dep%%[<>=]*}
4800be2 finddeps: Proper quoting, use double brackets
Lukas Fleischer authored
24 [[ $depname = $match ]] && echo "$d (depends)"
362a99b Pierre Schmitz apply common coding style
pierres authored
25 done
26 for dep in "${makedepends[@]}"; do
ba7cc13 Jan Alexander Steffens Fix spelling
heftig authored
27 # lose the version comparator, if any
362a99b Pierre Schmitz apply common coding style
pierres authored
28 depname=${dep%%[<>=]*}
4800be2 finddeps: Proper quoting, use double brackets
Lukas Fleischer authored
29 [[ $depname = $match ]] && echo "$d (makedepends)"
362a99b Pierre Schmitz apply common coding style
pierres authored
30 done
38f85d6 Ray Rashif support optdepends
schivmeister authored
31 for dep in "${optdepends[@]/:*}"; do
32 # lose the version comaparator, if any
33 depname=${dep%%[<>=]*}
4800be2 finddeps: Proper quoting, use double brackets
Lukas Fleischer authored
34 [[ $depname = $match ]] && echo "$d (optdepends)"
38f85d6 Ray Rashif support optdepends
schivmeister authored
35 done
362a99b Pierre Schmitz apply common coding style
pierres authored
36 fi
c229a69 Aaron Griffin Add finddeps script from cvs-arch
phrakture authored
37 done
Something went wrong with that request. Please try again.