FS#73194 - [dkms] pacman hook should handle hyphens in module versions

Attached to Project: Arch Linux
Opened by StuMcp (StuMcp) - Wednesday, 29 December 2021, 23:07 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:17 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


DKMS modules with hyphens in the version string get improperly renamed when the hook is run (e.g. kernel upgrade).

The issue is caused by the hook not parsing the source directory name in the same manner that it was created (module name followed by hyphen then version string).

Attached patch makes the module name regex match non-greedy so it will only match on the first hyphen.

Additional info:
* package version(s) DMKS 3.0.3-1
* config and/or log files etc. Issue is in /usr/share/libalpm/scripts/dkms
* link to upstream bug report, if any N/A

Steps to reproduce:
Install a DKMS module with a hyphen in the version string, upgrade the kernel (or run the hook) then observe the new name of the DKMS module (which will be the module name and the version string up to the last hyphen).
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:17 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/dkms/issues/1
Comment by StuMcp (StuMcp) - Thursday, 30 December 2021, 12:01 GMT
Please consider this updated patch instead, it sources the module name and version from dkms.conf (so that hyphens in module names will not be an issue). Tested with a kernel upgrade from 5.15.11 to 5.15.12 and modules with hyphens in the version were correctly rebuilt without being renamed.