New review comment by ahesford on void-packages repository https://github.com/void-linux/void-packages/pull/37139#discussion_r876032216 Comment: The trigger already fails to verify that the module name reported by DKMS, so let's not worry about it. If you really think this could be an issue, verify that `"$1" = "${_modname}"` or skip the iteration. My other suggestion had two bugs: 1. the shift shouldn't be applied because it is already done outside the loop (this is also a bug in the existing `shift 2; continue` line); 2. I'm not setting the kernel version properly. I think the proper solution is something more like ```sh remove_modules() { local _modname _modver _kver _line _arch _status # Remove the specified modules from all kernels. set -- ${dkms_modules} while [ $# -gt 0 ]; do $DKMS status -m "$1" | while IFS="/, " read _modname _modver _line; do [ "$1" = "${_modname}" ] || continue _modver="${_modver%:}" if [ "${_line}" = added ]; then # The module wasn't built successfully for any kernel version echo -n "Cleaning up DKMS module '${_modname}-${_modver}'... " $DKMS remove -m "${_modname}" -v "${_modver}" >/dev/null 2>&1 continue fi read _kver _arch _status <<-EOF ${_line} EOF case "${_status}" in added|built|installed) ;; *) break ;; esac echo -n "Removing DKMS module '${_modname}-${_modver}' for kernel-${_kver}... " $DKMS remove -m "${_modname}" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1 done shift 2 done } ```