File tree Expand file tree Collapse file tree 3 files changed +49
-10
lines changed Expand file tree Collapse file tree 3 files changed +49
-10
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ are ignored. See example above.
172
172
173
173
rdep
174
174
----
175
- Dependencies: wget
175
+ Dependencies: wget, optionally tar, xz and lz4
176
176
177
177
Accepts one or more cat/pns and prints their reverse dependencies.
178
178
The data is fetched from qa-reports.g.o. Typical usage::
@@ -184,6 +184,11 @@ all data and have it put into ``${TMPDIR:-/tmp}/mgorny-dev-scripts``::
184
184
185
185
rdep-fetch-cache
186
186
187
+ If lz4 is installed, the cache will be saved as a ``.tar.lz4 `` archive
188
+ for space- and performance-efficient lookup; otherwise it will be saved
189
+ as uncompressed ``.tar ``. If ``bsdtar `` is installed, it will be used
190
+ instead of ``tar `` as it supports fast reads.
191
+
187
192
188
193
Bugzilla helpers
189
194
================
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
# print revdeps of packages specified on command-line
3
3
4
- fetch () {
5
- if [ -d " ${TMPDIR:-/ tmp} " /mgorny-dev-scripts/${1} index ]; then
6
- cat " ${TMPDIR:-/ tmp} " /mgorny-dev-scripts/${1} index/${pkg}
7
- else
8
- wget -q -O - https://qa-reports.gentoo.org/output/genrdeps/${1} index/${pkg}
4
+ # bsdtar is faster than GNU tar
5
+ if command -v bsdtar > /dev/null; then
6
+ TAR=" bsdtar -xqOf"
7
+ else
8
+ TAR=" tar -xOf"
9
+ fi
10
+
11
+ # find the best cache available
12
+ CACHEDIR=${TMPDIR:-/ tmp} /mgorny-dev-scripts
13
+ GET=
14
+ if [ -d " ${CACHEDIR} " ]; then
15
+ cd " ${CACHEDIR} " || exit 1
16
+ if [ -f rdeps.tar.lz4 ]; then
17
+ GET=" ${TAR} rdeps.tar.lz4 "
18
+ elif [ -f rdeps.tar ]; then
19
+ GET=" ${TAR} rdeps.tar "
20
+ elif [ -d rindex ]; then
21
+ GET=" cat "
9
22
fi
23
+ fi
24
+
25
+ # use wget if no cache available
26
+ if [ -z " ${GET} " ]; then
27
+ echo " [Fetching from qa-reports, please consider running rdep-fetch-cache]" >&2
28
+ GET=" wget -q -O - https://qa-reports.gentoo.org/output/genrdeps/"
29
+ fi
30
+
31
+
32
+ fetch () {
33
+ ${GET}${1} index/${pkg}
10
34
}
11
35
12
36
for pkg; do
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
# fetch cache for rdep
3
3
4
- mkdir -p " ${TMPDIR:-/ tmp} " /mgorny-dev-scripts &&
5
- cd " ${TMPDIR:-/ tmp} " /mgorny-dev-scripts &&
6
- exec wget -O - https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz |
7
- tar -xJ
4
+ mkdir -p " ${TMPDIR:-/ tmp} " /mgorny-dev-scripts || exit 1
5
+ cd " ${TMPDIR:-/ tmp} " /mgorny-dev-scripts || exit 1
6
+
7
+ if command -v lz4 > /dev/null; then
8
+ echo " lz4 available, repacking as rdeps.tar.lz4" >&2
9
+
10
+ exec wget -O - https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz |
11
+ xz -cd | lz4 -c > rdeps.tar.lz4
12
+ else
13
+ echo " fetching to rdeps.tar (install lz4 to compress)" >&2
14
+
15
+ exec wget -O - https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz |
16
+ xz -cd > rdeps.tar
17
+ fi
You can’t perform that action at this time.
0 commit comments