Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH 3/3] ecompress: Also report duplicate pre-compressed files
Date: Tue, 25 Sep 2018 19:49:10
Message-Id: 295fecda-18b5-3e96-0c04-4ff9a650eb2f@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 3/3] ecompress: Also report duplicate pre-compressed files by "Michał Górny"
1 On 09/25/2018 12:18 PM, Michał Górny wrote:
2 > ---
3 > bin/ecompress | 1 +
4 > bin/ecompress-file | 9 +++------
5 > 2 files changed, 4 insertions(+), 6 deletions(-)
6 >
7 > diff --git a/bin/ecompress b/bin/ecompress
8 > index e4fdc3934..4a2c8a99a 100755
9 > --- a/bin/ecompress
10 > +++ b/bin/ecompress
11 > @@ -53,6 +53,7 @@ while [[ $# -gt 0 ]] ; do
12 > # skip the compressed variants (bug #667072)
13 > case ${path} in
14 > *.Z|*.gz|*.bz2|*.lzma|*.xz)
15 > + touch "${T}"/.ecompress_had_precompressed
16
17 While we're here, for efficiency we should use the builtin >> operator
18 instead of touch (also touch has broken in the past,
19 https://bugs.gentoo.org/348640).
20
21 > [[ -s ${path%.*} ]] && continue
22 > ;;
23 > esac
24 > diff --git a/bin/ecompress-file b/bin/ecompress-file
25 > index 27695da1b..bc8fe5451 100755
26 > --- a/bin/ecompress-file
27 > +++ b/bin/ecompress-file
28 > @@ -22,16 +22,13 @@ compress_file() {
29 > case ${x} in
30 > *.gz|*.Z)
31 > gunzip -f "${x}" || __helpers_die "gunzip failed"
32 > - x=${x%.*}
33 > - touch "${T}/.ecompress_had_precompressed";;
34 > + x=${x%.*};;
35 > *.bz2)
36 > bunzip2 -f "${x}" || __helpers_die "bunzip2 failed"
37 > - x=${x%.bz2}
38 > - touch "${T}/.ecompress_had_precompressed";;
39 > + x=${x%.bz2};;
40 > *.lzma|*.xz)
41 > unxz -f "${x}" || __helpers_die "unxz failed"
42 > - x=${x%.*}
43 > - touch "${T}/.ecompress_had_precompressed";;
44 > + x=${x%.*};;
45 > esac
46 >
47 > filtered_args+=( "$x" )
48 >
49 --
50 Thanks,
51 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature