Gentoo Archives: gentoo-dev

From: David Seifert <soap@g.o>
To: gentoo-dev@l.g.o
Cc: David Seifert <soap@g.o>
Subject: [gentoo-dev] [PATCH 3/3] perl-functions.eclass: [QA] use bash [[ ... ]] brackets
Date: Sat, 02 Jul 2022 18:01:35
Message-Id: 20220702180050.1709332-3-soap@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/3] perl-module.eclass: remove EAPI 5 by David Seifert
1 Signed-off-by: David Seifert <soap@g.o>
2 ---
3 eclass/perl-functions.eclass | 14 +++++++-------
4 1 file changed, 7 insertions(+), 7 deletions(-)
5
6 diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
7 index c1b67f54fa7..106394afa15 100644
8 --- a/eclass/perl-functions.eclass
9 +++ b/eclass/perl-functions.eclass
10 @@ -161,7 +161,7 @@ perl_fix_packlist() {
11
12 # remove files that dont exist
13 cat "${f}" | while read -r entry; do
14 - if [ ! -e "${D}/${entry}" ]; then
15 + if [[ ! -e ${D}/${entry} ]]; then
16 einfo "Pruning surplus packlist entry ${entry}"
17 grep -v -x -F "${entry}" "${f}" > "${packlist_temp}"
18 mv "${packlist_temp}" "${f}"
19 @@ -276,12 +276,12 @@ perl_check_env() {
20
21 for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do
22 # Next unless match
23 - [ -v $i ] || continue;
24 + [[ -v $i ]] || continue;
25
26 # Warn only once, and warn only when one of the bad values are set.
27 # record failure here.
28 - if [ ${errored:-0} == 0 ]; then
29 - if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
30 + if [[ ${errored:-0} == 0 ]]; then
31 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then
32 elog "perl-module.eclass: Suspicious environment values found.";
33 else
34 eerror "perl-module.eclass: Suspicious environment values found.";
35 @@ -293,7 +293,7 @@ perl_check_env() {
36 value=${!i};
37
38 # Print ENV name/value pair
39 - if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
40 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then
41 elog " $i=\"$value\"";
42 else
43 eerror " $i=\"$value\"";
44 @@ -301,10 +301,10 @@ perl_check_env() {
45 done
46
47 # Return if there were no failures
48 - [ ${errored:-0} == 0 ] && return;
49 + [[ ${errored:-0} == 0 ]] && return;
50
51 # Return if user knows what they're doing
52 - if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
53 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then
54 elog "Continuing anyway, seems you know what you're doing."
55 return
56 fi
57 --
58 2.35.1