1 |
commit: 1fc311ce0afeef9f982213e43220d079a4ffec26 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 26 22:29:30 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 26 22:39:31 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1fc311ce |
7 |
|
8 |
ecompress-file: de-duplicate filtered_args (bug 667072) |
9 |
|
10 |
Use an associated array to de-duplicate filtered_args, in order to |
11 |
ensure that compressor arguments are unique when a file is installed |
12 |
in both compressed and uncompressed forms. |
13 |
|
14 |
Bug: https://bugs.gentoo.org/667072 |
15 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
16 |
|
17 |
bin/ecompress-file | 6 +++--- |
18 |
1 file changed, 3 insertions(+), 3 deletions(-) |
19 |
|
20 |
diff --git a/bin/ecompress-file b/bin/ecompress-file |
21 |
index 18269c91b..e65b21ee4 100755 |
22 |
--- a/bin/ecompress-file |
23 |
+++ b/bin/ecompress-file |
24 |
@@ -13,7 +13,7 @@ compress_file() { |
25 |
done |
26 |
set +f |
27 |
mask_ext_re="^(${mask_ext_re:1})\$" |
28 |
- local filtered_args=() |
29 |
+ local -A filtered_args |
30 |
local had_precompressed= |
31 |
for x in "$@" ; do |
32 |
[[ ${x##*.} =~ $mask_ext_re ]] && continue |
33 |
@@ -35,10 +35,10 @@ compress_file() { |
34 |
had_precompressed=1;; |
35 |
esac |
36 |
|
37 |
- filtered_args+=( "$x" ) |
38 |
+ filtered_args[${x}]= |
39 |
done |
40 |
[[ ${#filtered_args[@]} -eq 0 ]] && return 0 |
41 |
- set -- "${filtered_args[@]}" |
42 |
+ set -- "${!filtered_args[@]}" |
43 |
|
44 |
if [[ ${had_precompressed} ]]; then |
45 |
eqawarn "One or more compressed files were found in docompress-ed directories." |