[PATCH 4/6] selinux-policy-2.eclass: use descriptive iterator names in for loops
Rahul Sandhu <[email protected]> Sat, 20 Jun 2026 07:21:31 +0000
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Message-ID | <[email protected]> |
Signed-off-by: Rahul Sandhu <[email protected]> --- eclass/selinux-policy-2.eclass | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass index 9d5a502c8c7c..c597f19c210a 100644 --- a/eclass/selinux-policy-2.eclass +++ b/eclass/selinux-policy-2.eclass @@ -197,12 +197,12 @@ selinux-policy-2_src_prepare() { fi # Collect only those files needed for this particular module - for i in ${MODS}; do - modfiles="$(find "${S}/refpolicy/policy/modules" -iname $i.te) $modfiles" - modfiles="$(find "${S}/refpolicy/policy/modules" -iname $i.fc) $modfiles" - modfiles="$(find "${S}/refpolicy/policy/modules" -iname $i.cil) $modfiles" + for mod in ${MODS}; do + modfiles="$(find "${S}/refpolicy/policy/modules" -iname "${mod}.te") ${modfiles}" + modfiles="$(find "${S}/refpolicy/policy/modules" -iname "${mod}.fc") ${modfiles}" + modfiles="$(find "${S}/refpolicy/policy/modules" -iname "${mod}.cil") ${modfiles}" if [[ ${add_interfaces} -eq 1 ]]; then - modfiles="$(find "${S}/refpolicy/policy/modules" -iname $i.if) $modfiles" + modfiles="$(find "${S}/refpolicy/policy/modules" -iname "${mod}.if") ${modfiles}" fi done @@ -299,11 +299,11 @@ selinux-policy-2_pkg_postinst() { einfo "Inserting the following modules into the ${type} module store: ${MODS}" cd "${ROOT}/usr/share/selinux/${type}" || die "Could not enter /usr/share/selinux/${type}" - for i in ${MODS}; do - if [[ -f "${i}.pp" ]]; then - COMMAND="${i}.pp ${COMMAND}" - elif [[ -f "${i}.cil" ]]; then - COMMAND="${i}.cil ${COMMAND}" + for mod in ${MODS}; do + if [[ -f "${mod}.pp" ]]; then + COMMAND="${mod}.pp ${COMMAND}" + elif [[ -f "${mod}.cil" ]]; then + COMMAND="${mod}.cil ${COMMAND}" fi done @@ -393,8 +393,8 @@ selinux-policy-2_pkg_postrm() { # build up the command in the case of multiple modules local COMMAND - for i in ${MODS}; do - COMMAND="-r ${i} ${COMMAND}" + for mod in ${MODS}; do + COMMAND="-r ${mod} ${COMMAND}" done for type in targeted strict mcs mls; do -- 2.54.0