Github messages for voidlinux
 help / color / mirror / Atom feed
From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
Date: Wed, 18 May 2022 17:18:46 +0200	[thread overview]
Message-ID: <20220518151846.VohCH6yk89IPzBfyoCTmZJbzFpvkBFgP6WzSooeLJtY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-37139@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

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
}


```

  parent reply	other threads:[~2022-05-18 15:18 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15  7:57 [PR PATCH] " subnut
2022-05-15  8:24 ` [PR PATCH] [Updated] " subnut
2022-05-15  8:35 ` [PR REVIEW] " subnut
2022-05-15  8:37 ` [PR PATCH] [Updated] " subnut
2022-05-15  9:07 ` [PR REVIEW] " subnut
2022-05-15 11:37 ` subnut
2022-05-15 11:40 ` subnut
2022-05-15 11:41 ` subnut
2022-05-15 11:41 ` subnut
2022-05-16  5:02 ` [PR PATCH] [Updated] " subnut
2022-05-17 12:39 ` [PR REVIEW] " ahesford
2022-05-17 12:39 ` ahesford
2022-05-17 12:39 ` ahesford
2022-05-18  2:48 ` subnut
2022-05-18  2:48 ` [PR PATCH] [Updated] " subnut
2022-05-18  4:04 ` [PR REVIEW] " subnut
2022-05-18  4:04 ` [PR PATCH] [Updated] " subnut
2022-05-18  4:16 ` [PR REVIEW] " subnut
2022-05-18  4:17 ` [PR PATCH] [Updated] " subnut
2022-05-18  4:18 ` subnut
2022-05-18  5:04 ` subnut
2022-05-18  5:05 ` [PR REVIEW] " subnut
2022-05-18  5:10 ` subnut
2022-05-18  5:14 ` [PR PATCH] [Updated] " subnut
2022-05-18 12:40 ` [PR REVIEW] " ahesford
2022-05-18 12:40 ` ahesford
2022-05-18 14:39 ` subnut
2022-05-18 14:54 ` subnut
2022-05-18 14:54 ` subnut
2022-05-18 15:18 ` ahesford [this message]
2022-05-18 15:30 ` [PR PATCH] [Updated] " subnut
2022-05-18 16:48 ` subnut
2022-05-18 17:36 ` subnut
2022-05-18 17:37 ` subnut
2022-05-21  1:51 ` [PR REVIEW] " ahesford
2022-05-21  1:51 ` ahesford
2022-05-21  4:08 ` [PR PATCH] [Updated] " subnut
2022-05-21  4:09 ` [PR REVIEW] " subnut
2022-05-21  4:16 ` [PR PATCH] [Updated] " subnut
2022-05-21  4:17 ` [PR REVIEW] " subnut
2022-05-24  2:19 ` [PR PATCH] [Updated] " subnut
2022-05-24  2:19 ` subnut
2022-05-24  2:25 ` subnut
2022-05-24 13:34 ` ahesford
2022-06-22  7:04 ` [PR PATCH] [Updated] " subnut
2022-06-22  7:10 ` [PR REVIEW] " subnut
2022-06-22  7:32 ` subnut
2022-06-22  8:04 ` [PR PATCH] [Updated] " subnut
2022-06-22  8:05 ` subnut
2022-06-22  8:07 ` subnut
2022-06-22  8:16 ` dkms: update to 3.0.4 " subnut
2022-06-22  8:18 ` subnut
2022-06-22  8:20 ` subnut
2022-06-22 12:29 ` [PR REVIEW] " ahesford
2022-06-22 12:29 ` ahesford
2022-06-22 14:57 ` subnut
2022-06-22 14:58 ` subnut
2022-06-22 14:58 ` subnut
2022-06-22 15:00 ` subnut
2022-06-22 15:25 ` ahesford
2022-06-22 15:48 ` [PR PATCH] [Updated] " subnut
2022-06-22 16:34 ` [PR REVIEW] " subnut
2022-06-22 16:35 ` subnut
2022-07-20 12:15 ` [PR PATCH] [Updated] " subnut
2022-07-20 12:17 ` subnut
2022-07-20 12:19 ` dkms: update to 3.0.6 " subnut
2022-07-21 14:31 ` [PR REVIEW] " ahesford
2022-07-21 16:23 ` ahesford
2022-07-21 16:23 ` ahesford
2022-07-31 18:27 ` [PR PATCH] [Updated] " subnut
2022-07-31 18:28 ` [PR REVIEW] " subnut
2022-07-31 18:32 ` [PR PATCH] [Updated] " subnut
2022-07-31 18:37 ` subnut
2022-07-31 18:41 ` subnut
2022-07-31 18:59 ` subnut
2022-07-31 19:00 ` subnut
2022-08-23 11:18 ` dataCobra
2022-08-29 20:25 ` [PR PATCH] [Closed]: " ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220518151846.VohCH6yk89IPzBfyoCTmZJbzFpvkBFgP6WzSooeLJtY@z \
    --to=ahesford@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).