-
Notifications
You must be signed in to change notification settings - Fork 1
/
depending-packages
executable file
·54 lines (54 loc) · 1.38 KB
/
depending-packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage:"
echo " $0 packagename"
echo "Finds all packages depending on $1 and prints their"
echo "source names (e.g. as input for a mass build)".
echo
echo "If called with -k, exclude packages from the Qt and"
echo "KDE buildlists (since they have to be built in the"
echo "right order and have typically been built with"
echo "the update script anyway)"
echo
echo "If called with -p, add a \"openmandriva/\" prefix"
echo "to each package name (as input for abf chain_build)"
echo "Use \"-p=xyz/\" to get a xyz/ prefix instead."
echo
echo "Try: $0 lib64qt5core5"
exit 1
fi
PREFIX=""
while [ "${1:0:1}" = "-" ]; do
case "$1" in
-k)
EXCLUDEKDE=true
;;
-p=*)
PREFIX="${1:3}"
;;
-p)
PREFIX=openmandriva/
;;
esac
shift
done
PKG="$1"
# If the package depends on itself, exclude it so we don't
# trigger an infinite rebuild loop...
SELF="$(dnf repoquery --qf '%{SOURCERPM}' $PKG |rev |cut -d- -f3- |rev)"
EXCLUDES="^($SELF"
if [ "$EXCLUDEKDE" = "true" ]; then
for x in $(for BL in qt kf pd kapps; do
cat $(dirname $0)/$BL.buildlist |while read r; do
for i in $r; do
echo $i |cut -d/ -f2
done
done
done); do
[ "$x" != "$SELF" ] && EXCLUDES="$EXCLUDES|$x"
done
fi
EXCLUDES="$EXCLUDES)\$"
dnf repoquery --qf '%{SOURCERPM}' --whatrequires $PKG |rev |cut -d- -f3- |rev |sort |uniq |grep -vE "$EXCLUDES" |while read r; do
echo $PREFIX$r
done