Current code: ``` [[ -s ${d} ]] && docinto / && dodoc "${d}" ``` proposed code: ``` [[ -f "${d}" && -s ${d} ]] && docinto / && dodoc "${d}" ``` Also it's unknown to me what is the purpose of executing `docinto /` in the loop.
So, yes. Looking at the algo in PMS, and the bash docs, -f + -s would indeed be more correct. And the docinto could be moved to the top of the subshell scope. Do you want to write a patch/pull request?
Ok, so PR is here - https://github.com/gentoo/portage/pull/57. It doesn't include the docinto changes because of https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-15400012.2.2 and https://bugs.gentoo.org/show_bug.cgi?id=566654.
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=843ad4b4b9878d5d10b4e1be2229960100e482ce