-
Notifications
You must be signed in to change notification settings - Fork 8
/
rdep
executable file
·49 lines (43 loc) · 1.03 KB
/
rdep
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
#!/bin/sh
# print revdeps of packages specified on command-line
# (c) 2019-2024 Michał Górny <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later
# bsdtar is faster than GNU tar
if command -v bsdtar >/dev/null; then
TAR="bsdtar -xqOf"
else
TAR="tar -xOf"
fi
# find the best cache available
CACHEDIR=${TMPDIR:-/tmp}/mgorny-dev-scripts
GET=
if [ -d "${CACHEDIR}" ]; then
cd "${CACHEDIR}" || exit 1
if [ -f rdeps.tar.lz4 ]; then
GET="${TAR} rdeps.tar.lz4 "
elif [ -f rdeps.tar ]; then
GET="${TAR} rdeps.tar "
elif [ -d rindex ]; then
GET="cat "
fi
fi
# use wget if no cache available
if [ -z "${GET}" ]; then
echo "[Fetching from qa-reports, please consider running rdep-fetch-cache]" >&2
GET="wget -q -O - https://qa-reports.gentoo.org/output/genrdeps/"
fi
fetch() {
${GET}${1}index/${pkg}
}
for pkg; do
echo "== rdep of ${pkg} ==" >&2
fetch r
echo "== ddep of ${pkg} ==" >&2
fetch d
echo "== bdep of ${pkg} ==" >&2
fetch b
echo "== pdep of ${pkg} ==" >&2
fetch p
echo "== idep of ${pkg} ==" >&2
fetch i
done