Re: [PATCH 4/6] selinux-policy-2.eclass: use descriptive iterator names in for loops
Sam James <[email protected]> Sat, 20 Jun 2026 22:10:52 +0100
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Organization | Gentoo |
| Message-ID | <[email protected]> |
Rahul Sandhu <[email protected]> writes: > 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 Missing a 'local mod'? (I think 'local i' was missing too.) > > for type in targeted strict mcs mls; do
signature.asc
(application/pgp-signature, 418 B)
-----BEGIN PGP SIGNATURE----- iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmo3AdwbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkNkX AQDxMvZzb6G8dMHsQ6h64PMpOeWCwCoFqQyvEQ/Qzlda7AEAsepfEWP8jkG2Atb+ Pj3xcdy3AadVrSvSmZmOvEi4nQc= =tFDs -----END PGP SIGNATURE-----