diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template index ac1ccecffa5..ee16e8c3aeb 100644 --- a/srcpkgs/dkms/template +++ b/srcpkgs/dkms/template @@ -3,7 +3,7 @@ pkgname=dkms version=3.0.6 revision=1 conf_files="/etc/dkms/framework.conf" -depends="bash kmod gcc make coreutils" +depends="bash kmod gcc make coreutils xbps-triggers>=0.123_1" short_desc="Dynamic Kernel Module Support" maintainer="Orphaned " license="GPL-2.0-or-later" diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms index fcd64efd030..6b285c576b5 100755 --- a/srcpkgs/xbps-triggers/files/dkms +++ b/srcpkgs/xbps-triggers/files/dkms @@ -2,7 +2,7 @@ # # DKMS trigger. Used to add/build/install or remove the specified modules # from all kernels. -# +# # Modules can be specified like: # dkms_modules=" ..." # @@ -21,19 +21,24 @@ UPDATE="$5" export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin" remove_modules() { - local _modver _kver - # Remove the specified modules from all kernels. set -- ${dkms_modules} while [ $# -gt 0 ]; do - $DKMS status -m "$1" | while read line; do - if $(echo "$line" | egrep -vq '(added|built|installed)'); then - shift 2; continue + $DKMS status -m "$1" | while read -r line; do + IFS=" ,:/" read -r modname modver kver arch status _ <<-EOF + $line + EOF + if [ "${line#*: }" = added ]; then + # The module wasn't built successfully for any kernel version + printf %s "Cleaning up DKMS module '$modname-$modver'... " + $DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1 + elif [ "$status" = installed ] || [ "$status" = built ]; then + printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... " + $DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1 + else + # Invalid output + continue fi - _modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d") - _kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/") - echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... " - $DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1 if [ $? -eq 0 ]; then echo "done." else diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index b1e4f34a4dd..f0249f6f996 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -1,6 +1,6 @@ # Template file for 'xbps-triggers' pkgname=xbps-triggers -version=0.122 +version=0.123 revision=1 bootstrap=yes short_desc="XBPS triggers for Void Linux"