1 |
commit: e42e9b61024d752a3dfb56ab8e8ea6936333ec58 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 7 05:05:48 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 7 05:05:48 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e42e9b61 |
7 |
|
8 |
phase-helpers.sh: optimize array length tests |
9 |
|
10 |
Reported-by: R0b0t1 <r030t1 <AT> gmail.com> |
11 |
|
12 |
bin/phase-helpers.sh | 10 +++++----- |
13 |
1 file changed, 5 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh |
16 |
index 23cf80b39..49dad234d 100644 |
17 |
--- a/bin/phase-helpers.sh |
18 |
+++ b/bin/phase-helpers.sh |
19 |
@@ -810,7 +810,7 @@ __eapi4_src_install() { |
20 |
|
21 |
__eapi6_src_prepare() { |
22 |
if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then |
23 |
- [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" |
24 |
+ [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}" |
25 |
elif [[ -n ${PATCHES} ]]; then |
26 |
eapply ${PATCHES} |
27 |
fi |
28 |
@@ -965,7 +965,7 @@ if ___eapi_has_einstalldocs; then |
29 |
[[ -f ${d} && -s ${d} ]] && docinto / && dodoc "${d}" |
30 |
done |
31 |
elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then |
32 |
- [[ ${DOCS[@]} ]] && docinto / && dodoc -r "${DOCS[@]}" |
33 |
+ [[ ${#DOCS[@]} -gt 0 ]] && docinto / && dodoc -r "${DOCS[@]}" |
34 |
else |
35 |
[[ ${DOCS} ]] && docinto / && dodoc -r ${DOCS} |
36 |
fi |
37 |
@@ -973,7 +973,7 @@ if ___eapi_has_einstalldocs; then |
38 |
|
39 |
( |
40 |
if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then |
41 |
- [[ ${HTML_DOCS[@]} ]] && \ |
42 |
+ [[ ${#HTML_DOCS[@]} -gt 0 ]] && \ |
43 |
docinto html && dodoc -r "${HTML_DOCS[@]}" |
44 |
else |
45 |
[[ ${HTML_DOCS} ]] && \ |
46 |
@@ -1040,7 +1040,7 @@ if ___eapi_has_eapply; then |
47 |
done |
48 |
fi |
49 |
|
50 |
- if [[ -z ${files[@]} ]]; then |
51 |
+ if [[ ${#files[@]} -eq 0 ]]; then |
52 |
die "eapply: no files specified" |
53 |
fi |
54 |
|
55 |
@@ -1062,7 +1062,7 @@ if ___eapi_has_eapply; then |
56 |
|
57 |
local files=() |
58 |
_eapply_get_files "${f}" |
59 |
- [[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}" |
60 |
+ [[ ${#files[@]} -eq 0 ]] && die "No *.{patch,diff} files in directory ${f}" |
61 |
|
62 |
einfo "Applying patches from ${f} ..." |
63 |
local f2 |