1 |
On 09/25/2018 12:55 PM, Zac Medico wrote: |
2 |
> On 09/25/2018 12:18 PM, Michał Górny wrote: |
3 |
>> Fix crash due to race condition in handling the same file being present |
4 |
>> both in compressed and uncompressed variants. If that is the case, |
5 |
>> just queue the uncompressed variant for compression, and ignore |
6 |
>> the other compressed variants. |
7 |
>> |
8 |
>> Bug: https://bugs.gentoo.org/667072 |
9 |
>> Signed-off-by: Michał Górny <mgorny@g.o> |
10 |
>> --- |
11 |
>> bin/ecompress | 7 +++++++ |
12 |
>> 1 file changed, 7 insertions(+) |
13 |
>> |
14 |
>> diff --git a/bin/ecompress b/bin/ecompress |
15 |
>> index 36bdb585b..d5ff3796c 100755 |
16 |
>> --- a/bin/ecompress |
17 |
>> +++ b/bin/ecompress |
18 |
>> @@ -49,6 +49,13 @@ while [[ $# -gt 0 ]] ; do |
19 |
>> find_args+=( -size "+${PORTAGE_DOCOMPRESS_SIZE_LIMIT}c" ) |
20 |
>> |
21 |
>> while IFS= read -d '' -r path; do |
22 |
>> + # if both compressed and uncompressed variant exists, |
23 |
>> + # skip the compressed variants (bug #667072) |
24 |
>> + case ${path} in |
25 |
>> + *.Z|*.gz|*.bz2|*.lzma|*.xz) |
26 |
>> + [[ -s ${path%.*} ]] && continue |
27 |
>> + ;; |
28 |
>> + esac |
29 |
> |
30 |
> In theory, we'd still have a problem if the file existed with muliple |
31 |
> compressions, right? Maybe a good solution is to strip the compression |
32 |
> extension here, and then have ecompress-file check for duplicates? |
33 |
|
34 |
Alternatively, we could uncompress the pre-compressed files right here. |
35 |
-- |
36 |
Thanks, |
37 |
Zac |