From e683c257db6caeab11d4b44c3c7d3ccb78c36a14 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 20 Feb 2011 00:28:33 +0100 Subject: [PATCH] xbps-triggers: improve the dkms trigger, bump to 0.16. --- srcpkgs/xbps-triggers/files/dkms | 19 ++++++++++++------- srcpkgs/xbps-triggers/template | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms index 915ed6a3bdf..b7267fe1887 100755 --- a/srcpkgs/xbps-triggers/files/dkms +++ b/srcpkgs/xbps-triggers/files/dkms @@ -22,18 +22,19 @@ DKMS=usr/sbin/dkms remove_modules() { - local ver + 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 + $DKMS status -m "$1" | while read line; do + if $(echo "$line" | egrep -vq '(added|built|installed)'); then shift; shift; continue fi - ver=$(echo "$line" | sed "s/$1,\([^,]*\)[,:].*/\1/;t;d") - echo -n "Removing DKMS module '$1-$ver'... " - $DKMS remove -m $1 -v $ver --all >/dev/null 2>&1 + _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 @@ -62,9 +63,13 @@ add_modules() for f in $(echo lib/modules/*); do _kver=$(basename $f) + if [ ! -e "${f}/build/include" ]; then + echo "Skipping kernel-${_kver}. kernel-headers package not installed..." + continue + fi set -- ${dkms_modules} while [ $# -gt 0 ]; do - echo -n "Installing DKMS module '$1-$2' for kernel ${_kver}... " + echo -n "Installing DKMS module '$1-$2' for kernel-${_kver}... " $DKMS build -m "$1" -v "$2" -k "${_kver}" >/dev/null 2>&1 && \ $DKMS install -m "$1" -v "$2" -k "${_kver}" >/dev/null 2>&1 if [ $? -eq 0 ]; then diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index bec484d1474..680bad29a6e 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.15 +version=0.16 build_style=custom-install short_desc="XBPS triggers" maintainer="Juan RP "