1 |
Ignore files passed to docompress -x in the QA check for |
2 |
precompressed files. |
3 |
|
4 |
Bug: https://bugs.gentoo.org/721516 |
5 |
Signed-off-by: Zac Medico <zmedico@g.o> |
6 |
--- |
7 |
bin/ecompress | 16 ++++++++++++++-- |
8 |
1 file changed, 14 insertions(+), 2 deletions(-) |
9 |
|
10 |
diff --git a/bin/ecompress b/bin/ecompress |
11 |
index dfa1a0b44..2d74ed07a 100755 |
12 |
--- a/bin/ecompress |
13 |
+++ b/bin/ecompress |
14 |
@@ -19,16 +19,28 @@ while [[ $# -gt 0 ]] ; do |
15 |
shift |
16 |
|
17 |
skip_dirs=() |
18 |
+ skip_files=() |
19 |
for skip; do |
20 |
if [[ -d ${ED%/}/${skip#/} ]]; then |
21 |
skip_dirs+=( "${ED%/}/${skip#/}" ) |
22 |
else |
23 |
rm -f "${ED%/}/${skip#/}.ecompress" || die |
24 |
+ skip_files+=("${ED%/}/${skip#/}") |
25 |
fi |
26 |
done |
27 |
|
28 |
if [[ ${#skip_dirs[@]} -gt 0 ]]; then |
29 |
- find "${skip_dirs[@]}" -name '*.ecompress' -delete || die |
30 |
+ while read -r -d ''; do |
31 |
+ skip_files+=(${REPLY#.ecompress}) |
32 |
+ done < <(find "${skip_dirs[@]}" -name '*.ecompress' -print0 -delete || die) |
33 |
+ fi |
34 |
+ |
35 |
+ if [[ ${#skip_files[@]} -gt 0 && -s ${T}/.ecompress_had_precompressed ]]; then |
36 |
+ sed_args=() |
37 |
+ for f in "${skip_files[@]}"; do |
38 |
+ sed_args+=(-e "s|^${f}\$||") |
39 |
+ done |
40 |
+ sed "${sed_args[@]}" -e '/^$/d' -i "${T}/.ecompress_had_precompressed" || die |
41 |
fi |
42 |
|
43 |
exit 0 |
44 |
@@ -176,7 +188,7 @@ find "${ED}" -name '*.ecompress' -delete -print0 | |
45 |
___parallel_xargs -0 "${PORTAGE_BIN_PATH}"/ecompress-file |
46 |
ret=${?} |
47 |
|
48 |
-if [[ -f ${T}/.ecompress_had_precompressed ]]; then |
49 |
+if [[ -s ${T}/.ecompress_had_precompressed ]]; then |
50 |
eqawarn "One or more compressed files were found in docompress-ed directories." |
51 |
eqawarn "Please fix the ebuild not to install compressed files (manpages," |
52 |
eqawarn "documentation) when automatic compression is used:" |
53 |
-- |
54 |
2.25.3 |