[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2020-05-21 Thread Sébastien Luttringer via arch-commits
Date: Thursday, May 21, 2020 @ 08:25:06
  Author: seblu
Revision: 387358

upgpkg: dkms 2.8.1-3

- fix FS#66653
- fix FS#62879

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |   12 ++--
 hook.sh  |   22 ++
 2 files changed, 20 insertions(+), 14 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2020-05-21 07:27:40 UTC (rev 387357)
+++ PKGBUILD2020-05-21 08:25:06 UTC (rev 387358)
@@ -3,7 +3,7 @@
 
 pkgname=dkms
 pkgver=2.8.1
-pkgrel=2
+pkgrel=3
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
 url='https://github.com/dell/dkms'
@@ -21,11 +21,11 @@
 'hook.remove'
 'hook.sh'
 '0001-Revert-Make-newly-installed-modules-available-immedi.patch')
-md5sums=('SKIP'
- 'be9784c5c5bbc92fa2d18f0b5f4cd0c4'
- 'b7b9f471a84aecbe063065db98f45162'
- '80632f6a454b35bcade2bed287f13c7b'
- 'd3b91ef709f567a375f4bbdbd3291d2b')
+sha256sums=('SKIP'
+'047e0e46967e98fbf3ff8860a80f259c28693d5989373d5a5395714495b59844'
+'c3e3a20857e628116bde499af1b3614bcafb49dbe9b5775cfcf0aa862af1750a'
+'3463adfe18dad0805a806c2fb0fc4faf88924056168980a3c7cbc28a27c8867b'
+'124b821b1b44ba365d915945825bcf32c1077655c3a98eb1644de56b6abfcd09')
 
 prepare() {
   cd dkms

Modified: hook.sh
===
--- hook.sh 2020-05-21 07:27:40 UTC (rev 387357)
+++ hook.sh 2020-05-21 08:25:06 UTC (rev 387358)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 #
-# Copyright © 2018 Sébastien Luttringer
+# Copyright © 2018-2020, Sébastien Luttringer
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -21,6 +21,8 @@
 run() {
echo "==> $*"
"$@" > /dev/null
+   local ret=$?
+   (( $ret )) && echo "==> Warning, \`$*' returned $ret"
 }
 
 # check whether the dependencies of a module are installed
@@ -28,8 +30,10 @@
 # $2: kernel version
 check_dependency() { (
source "$source_tree/${1/\//-}/dkms.conf"
+   local state
for dep in "${BUILD_DEPENDS[@]}"; do
-   if ! [[ "$(dkms status -m "$dep" -k "$2")" =~ 
:[[:space:]]installed$ ]]; then
+   state=$(dkms status -m "$dep" -k "$2")
+   if ! [[ "$state" =~ "$mod, $mver, $kver, "[^:]+': installed' 
]]; then
exit 1
fi
done
@@ -113,13 +117,15 @@
 
 # remove registered modules when built/installed
 dkms_remove() {
-   local nvk mod kver
+   local nvk mod mver kver state
for nvk in "${!DKMS_MODULES[@]}"; do
-   mod=${nvk%/*}
-   kver=${nvk##*/}
-   state=$(dkms status -m "$mod" -k "$kver")
-   if [[ "$state" =~ :[[:space:]](built|installed)$ ]]; then
-   run dkms remove "$mod" -k "$kver"
+   [[ "$nvk" =~ ([^/]+)/([^/]+)/(.+) ]]
+   mod="${BASH_REMATCH[1]}"
+   mver="${BASH_REMATCH[2]}"
+   kver="${BASH_REMATCH[3]}"
+   state=$(dkms status -m "$mod" -v "$mver" -k "$kver")
+   if [[ "$state" =~ "$mod, $mver, $kver, "[^:]+": 
"(built|installed) ]]; then
+   run dkms remove "$mod" -v "$mver" -k "$kver"
fi
unset DKMS_MODULES[$nvk]
done


[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2018-10-26 Thread Sébastien Luttringer via arch-commits
Date: Friday, October 26, 2018 @ 13:40:27
  Author: seblu
Revision: 337321

upgpkg: dkms 2.5-4

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |4 ++--
 hook.sh  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2018-10-26 13:05:21 UTC (rev 337320)
+++ PKGBUILD2018-10-26 13:40:27 UTC (rev 337321)
@@ -3,7 +3,7 @@
 
 pkgname=dkms
 pkgver=2.5
-pkgrel=3
+pkgrel=4
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
 url='https://github.com/dell/dkms'
@@ -24,7 +24,7 @@
 md5sums=('SKIP'
  '90f1486e0af9aab85e8c60d456802c63'
  '2e8ffd0c2ddec02872d0234befd129fd'
- '0dd4819d19fcafc817a96dd5b0a60fd8'
+ '80632f6a454b35bcade2bed287f13c7b'
  'd3b91ef709f567a375f4bbdbd3291d2b')
 
 prepare() {

Modified: hook.sh
===
--- hook.sh 2018-10-26 13:05:21 UTC (rev 337320)
+++ hook.sh 2018-10-26 13:40:27 UTC (rev 337321)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 #
-# Copyright © 2017 Sébastien Luttringer
+# Copyright © 2018 Sébastien Luttringer
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License


[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2018-10-26 Thread Sébastien Luttringer via arch-commits
Date: Friday, October 26, 2018 @ 13:05:21
  Author: seblu
Revision: 337320

hook.sh: Improve check_dependency and check_buildexclusive

>From 9069728e4ba60df6ada86610818baff11fdabf8f Mon Sep 17 00:00:00 2001
From: Eli Schwartz 
Date: Wed, 6 Jun 2018 12:35:42 -0400
Subject: [PATCH 1/2] simplify the hook script

Instead of copying the BUILD_DEPENDS array from a subshell that sources
the dkms.conf and uses a herestring to pass that to readarray, run the
whole function in a subshell. It needs one subshell either way, and
heredocs use a temporary file which is just totally unnecessary albeit
minimal overhead in this case.

Heredocs also invoke command substitution which strips newlines, and do
not support \0 which means readarray needs to re-split the content based
on newlines instead. Neither of these are likely to matter in this
case... but why not just avoid it, if it is free to do so?
Both of these could be solved by using < <(commands) which communicates
via a file instead of command substitution. But that still results in an
unnecessary temporary file.

Instead of copying the BUILD_EXCLUSIVE_KERNEL variable from a subshell
that sources the dkms.conf and uses a herestring to pass that to
readarray, simply use command substitution to assign the value to the
variable. The herestring is once again inefficiently opening a temporary
file, except this time it is totally unnecessary as the value in the
dkms.conf is not an array and does not need to be split into one

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |2 +-
 hook.sh  |   20 
 2 files changed, 9 insertions(+), 13 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2018-10-26 12:06:56 UTC (rev 337319)
+++ PKGBUILD2018-10-26 13:05:21 UTC (rev 337320)
@@ -24,7 +24,7 @@
 md5sums=('SKIP'
  '90f1486e0af9aab85e8c60d456802c63'
  '2e8ffd0c2ddec02872d0234befd129fd'
- 'a71fcf1bfb037047c4d9321e189e06a2'
+ '0dd4819d19fcafc817a96dd5b0a60fd8'
  'd3b91ef709f567a375f4bbdbd3291d2b')
 
 prepare() {

Modified: hook.sh
===
--- hook.sh 2018-10-26 12:06:56 UTC (rev 337319)
+++ hook.sh 2018-10-26 13:05:21 UTC (rev 337320)
@@ -26,25 +26,21 @@
 # check whether the dependencies of a module are installed
 # $1: module name/module version
 # $2: kernel version
-check_dependency() {
-   local -a BUILD_DEPENDS
-   readarray -t BUILD_DEPENDS <<<$(source 
"$source_tree/${1/\//-}/dkms.conf"; printf '%s\n' "${BUILD_DEPENDS[@]}")
-   [[ -z ${BUILD_DEPENDS[@]} ]] && unset BUILD_DEPENDS
-   local mod
-   for mod in "${BUILD_DEPENDS[@]}"; do
-   if ! [[ "$(dkms status -m "$mod" -k "$2")" =~ 
:[[:space:]]installed$ ]]; then
-   return 1
+check_dependency() { (
+   source "$source_tree/${1/\//-}/dkms.conf"
+   for dep in "${BUILD_DEPENDS[@]}"; do
+   if ! [[ "$(dkms status -m "$dep" -k "$2")" =~ 
:[[:space:]]installed$ ]]; then
+   exit 1
fi
done
-   return 0
-}
+   exit 0
+) }
 
 # check whether the modules should be built with this kernel version
 # $1: module name/module version
 # $2: kernel version
 check_buildexclusive() {
-   local BUILD_EXCLUSIVE_KERNEL
-   readarray -t BUILD_EXCLUSIVE_KERNEL <<<$(source 
"$source_tree/${1/\//-}/dkms.conf"; printf '%s\n' "$BUILD_EXCLUSIVE_KERNEL")
+   local BUILD_EXCLUSIVE_KERNEL=$(source 
"$source_tree/${1/\//-}/dkms.conf"; printf '%s\n' "$BUILD_EXCLUSIVE_KERNEL")
[[ "$2" =~ $BUILD_EXCLUSIVE_KERNEL ]]
 }
 


[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2018-05-27 Thread Sébastien Luttringer via arch-commits
Date: Sunday, May 27, 2018 @ 20:53:25
  Author: seblu
Revision: 325050

Fix DKMS_ACTION access restriction

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |2 +-
 hook.sh  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2018-05-27 18:59:02 UTC (rev 325049)
+++ PKGBUILD2018-05-27 20:53:25 UTC (rev 325050)
@@ -25,7 +25,7 @@
 md5sums=('SKIP'
  '90f1486e0af9aab85e8c60d456802c63'
  '2e8ffd0c2ddec02872d0234befd129fd'
- 'acdc173fed3cfe3b109d1e08f24a0d81'
+ 'a71fcf1bfb037047c4d9321e189e06a2'
  'd3b91ef709f567a375f4bbdbd3291d2b')
 
 prepare() {

Modified: hook.sh
===
--- hook.sh 2018-05-27 18:59:02 UTC (rev 325049)
+++ hook.sh 2018-05-27 20:53:25 UTC (rev 325050)
@@ -152,7 +152,7 @@
# register DKMS action
case "$1" in
install|remove)
-   local -r DKMS_ACTION="$1"
+   declare -r DKMS_ACTION="$1"
;;
*)
echo "usage: ${0##*/} install|remove" >&2


[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2018-05-27 Thread Sébastien Luttringer via arch-commits
Date: Sunday, May 27, 2018 @ 18:57:50
  Author: seblu
Revision: 325046

upgpkg: dkms 2.5-2

- implement FS#52901 (module dep ordering)
- support BUILD_EXCLUSIVE_KERNEL

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |6 +-
 hook.sh  |  133 +
 2 files changed, 102 insertions(+), 37 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2018-05-26 23:25:31 UTC (rev 325045)
+++ PKGBUILD2018-05-27 18:57:50 UTC (rev 325046)
@@ -3,8 +3,8 @@
 # Contributor: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
 
 pkgname=dkms
-pkgver=2.6.1
-pkgrel=1
+pkgver=2.5
+pkgrel=2
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
 url='https://github.com/dell/dkms'
@@ -25,7 +25,7 @@
 md5sums=('SKIP'
  '90f1486e0af9aab85e8c60d456802c63'
  '2e8ffd0c2ddec02872d0234befd129fd'
- 'f1ea074ef22d1afe855a1eb63233566b'
+ 'acdc173fed3cfe3b109d1e08f24a0d81'
  'd3b91ef709f567a375f4bbdbd3291d2b')
 
 prepare() {

Modified: hook.sh
===
--- hook.sh 2018-05-26 23:25:31 UTC (rev 325045)
+++ hook.sh 2018-05-27 18:57:50 UTC (rev 325046)
@@ -23,31 +23,40 @@
"$@" > /dev/null
 }
 
-# check kernel is valid for action
-# it means kernel and its headers are installed
-# $1: kernel version
-check_kernel() {
-   local kver="$1"; shift
-   if [[ ! -d "$install_tree/$kver/kernel" ]]; then
-   echo "==> No kernel $kver modules. You must install them to use 
DKMS!"
-   return 1
-   elif [[ ! -d "$install_tree/$kver/build/include" ]]; then
-   echo "==> No kernel $kver headers. You must install them to use 
DKMS!"
-   return 1
-   fi
+# check whether the dependencies of a module are installed
+# $1: module name/module version
+# $2: kernel version
+check_dependency() {
+   local -a BUILD_DEPENDS
+   readarray -t BUILD_DEPENDS <<<$(source 
"$source_tree/${1/\//-}/dkms.conf"; printf '%s\n' "${BUILD_DEPENDS[@]}")
+   [[ -z ${BUILD_DEPENDS[@]} ]] && unset BUILD_DEPENDS
+   local mod
+   for mod in "${BUILD_DEPENDS[@]}"; do
+   if ! [[ "$(dkms status -m "$mod" -k "$2")" =~ 
:[[:space:]]installed$ ]]; then
+   return 1
+   fi
+   done
return 0
 }
 
+# check whether the modules should be built with this kernel version
+# $1: module name/module version
+# $2: kernel version
+check_buildexclusive() {
+   local BUILD_EXCLUSIVE_KERNEL
+   readarray -t BUILD_EXCLUSIVE_KERNEL <<<$(source 
"$source_tree/${1/\//-}/dkms.conf"; printf '%s\n' "$BUILD_EXCLUSIVE_KERNEL")
+   [[ "$2" =~ $BUILD_EXCLUSIVE_KERNEL ]]
+}
+
 # handle actions on module addition/upgrade/removal
 # $1: module name
 # $2: module version
-# $3: dkms action
 parse_module() {
pushd "$install_tree" >/dev/null
local path
for path in */build/; do
local kver="${path%%/*}"
-   dkms_register "$1" "$2" "$kver" "$3"
+   dkms_register "$1" "$2" "$kver"
done
popd >/dev/null
 }
@@ -54,34 +63,82 @@
 
 # handle actions on kernel addition/upgrade/removal
 # $1: kernel version
-# $2: dkms action
 parse_kernel() {
local path
for path in "$source_tree"/*-*/dkms.conf; do
if [[ -f "$path" && "$path" =~ 
^$source_tree/([^/]+)-([^/]+)/dkms\.conf$ ]]; then
-   dkms_register "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" 
"$1" "$2"
+   dkms_register "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" 
"$1"
fi
done
 }
 
-# register a dkms call
+# register a dkms module to install/remove
 # this function suppress echo call for a module
-# $1: module name, $2: module version, $3: kernel version, $4: action
+# $1: module name, $2: module version, $3: kernel version
 dkms_register() {
-   DKMS_ACTION["$1/$2/$3"]="$4"
+   DKMS_MODULES["$1/$2/$3"]=''
 }
 
-# run registered dkms commands
-dkms_run() {
+# install registered modules
+dkms_install() {
local nvk mod kver
-   for nvk in "${!DKMS_ACTION[@]}"; do
+   local -i retry=1
+
+   while (( $retry > 0 )); do
+   retry=0
+   for nvk in "${!DKMS_MODULES[@]}"; do
+   mod=${nvk%/*}
+   kver=${nvk##*/}
+   # do not build excluded modules
+   if ! check_buildexclusive "$mod" "$kver"; then
+   unset DKMS_MODULES[$nvk]
+   continue
+   # skip modules with missing kernel headers
+   elif [[ ! -d "$install_tree/$kver/build/include" ]]; 
then
+   DKMS_MODULES[$nvk]="Missing kernel headers"
+   continue
+   # skip 

[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2016-04-16 Thread Sébastien Luttringer
Date: Saturday, April 16, 2016 @ 23:10:42
  Author: seblu
Revision: 265066

upgpkg: dkms 2.2.0.3+git151023-10

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |4 ++--
 hook.sh  |9 +
 2 files changed, 11 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2016-04-16 19:35:11 UTC (rev 265065)
+++ PKGBUILD2016-04-16 21:10:42 UTC (rev 265066)
@@ -4,7 +4,7 @@
 
 pkgname=dkms
 pkgver=2.2.0.3+git151023
-pkgrel=9
+pkgrel=10
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
 url='http://linux.dell.com/dkms/'
@@ -26,7 +26,7 @@
  '82d520c39c99c34977e48b313a189c6c'
  'e6eada07fc3a56a491e14dfeafec746f'
  '57d90c89a221c52d78d0ec3953fe2fcf'
- '297fa3df7770d46aca6b0457ddb7cfad')
+ '11ab1f9d2b602cbf4817abce110681c1')
 
 prepare() {
   cd dkms

Modified: hook.sh
===
--- hook.sh 2016-04-16 19:35:11 UTC (rev 265065)
+++ hook.sh 2016-04-16 21:10:42 UTC (rev 265066)
@@ -91,6 +91,15 @@
install_tree='/usr/lib/modules'
source /etc/dkms/framework.conf
 
+   # check source_tree and install_tree exists
+   local path
+   for path in "$source_tree" "$install_tree"; do
+   if [[ ! -d "$path" ]]; then
+   echo "==> Missing mandatory directory: $path. Exiting!"
+   return 1
+   fi
+   done
+
# parse stdin paths to guess what do do
while read -r path; do
if [[ "/$path" =~ ^$source_tree/([^/]+)-([^/]+)/dkms\.conf$ ]]; 
then


[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2016-03-15 Thread Sébastien Luttringer
Date: Wednesday, March 16, 2016 @ 00:14:57
  Author: seblu
Revision: 261682

upgpkg: dkms 2.2.0.3+git151023-9

- quiet dkms output
- display dkms command run
- fix FS#48580

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |4 ++--
 hook.sh  |   18 +++---
 2 files changed, 13 insertions(+), 9 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2016-03-15 21:44:46 UTC (rev 261681)
+++ PKGBUILD2016-03-15 23:14:57 UTC (rev 261682)
@@ -4,7 +4,7 @@
 
 pkgname=dkms
 pkgver=2.2.0.3+git151023
-pkgrel=8
+pkgrel=9
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
 url='http://linux.dell.com/dkms/'
@@ -26,7 +26,7 @@
  '82d520c39c99c34977e48b313a189c6c'
  'e6eada07fc3a56a491e14dfeafec746f'
  '57d90c89a221c52d78d0ec3953fe2fcf'
- '5e5b2ca4bea3dfcaed67eec07d152381')
+ '297fa3df7770d46aca6b0457ddb7cfad')
 
 prepare() {
   cd dkms

Modified: hook.sh
===
--- hook.sh 2016-03-15 21:44:46 UTC (rev 261681)
+++ hook.sh 2016-03-15 23:14:57 UTC (rev 261682)
@@ -17,6 +17,12 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
 
+# display what to run and run it
+run() {
+   echo "==> $*"
+   "$@"
+}
+
 # check kernel is valid for action
 # it means kernel and its headers are installed
 # $1: kernel version
@@ -23,12 +29,10 @@
 check_kernel() {
local kver="$1"; shift
if [[ ! -d "$install_tree/$kver/kernel" ]]; then
-   echo "==> Kernel $kver modules are missing. Nothing will be 
done for this kernel!"
-   echo '==> You have to install the matching kernel package to 
use dkms'
+   echo "==> No kernel $kver modules. You must install them to use 
DKMS!"
return 1
elif [[ ! -d "$install_tree/$kver/build/include" ]]; then
-   echo "==> Kernel $kver headers are missing. Nothing will be 
done for this kernel!"
-   echo '==> You have to install the matching kernel headers 
package to use dkms'
+   echo "==> No kernel $kver headers. You must install them to use 
DKMS!"
return 1
fi
return 0
@@ -46,8 +50,8 @@
local path
for path in */build/; do
local kver="${path%%/*}"
-   check_kernel "$kver" || return
-   dkms "$@" -m "$modname" -v "$modver" -k "$kver"
+   check_kernel "$kver" || continue
+   run dkms -q "$@" -m "$modname" -v "$modver" -k "$kver"
done
popd >/dev/null
 }
@@ -62,7 +66,7 @@
local path
for path in "$source_tree"/*-*/dkms.conf; do
if [[ "$path" =~ ^$source_tree/([^/]+)-([^/]+)/dkms\.conf$ ]]; 
then
-   dkms "$@" -m "${BASH_REMATCH[1]}" -v 
"${BASH_REMATCH[2]}" -k "$kver"
+   run dkms -q "$@" -m "${BASH_REMATCH[1]}" -v 
"${BASH_REMATCH[2]}" -k "$kver"
fi
done
 }


[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2016-03-12 Thread Sébastien Luttringer
Date: Saturday, March 12, 2016 @ 19:46:53
  Author: seblu
Revision: 261385

upgpkg: dkms 2.2.0.3+git151023-8

- fix incorrect module version when calling dkms

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |4 ++--
 hook.sh  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2016-03-12 18:39:34 UTC (rev 261384)
+++ PKGBUILD2016-03-12 18:46:53 UTC (rev 261385)
@@ -4,7 +4,7 @@
 
 pkgname=dkms
 pkgver=2.2.0.3+git151023
-pkgrel=7
+pkgrel=8
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
 url='http://linux.dell.com/dkms/'
@@ -26,7 +26,7 @@
  '82d520c39c99c34977e48b313a189c6c'
  'e6eada07fc3a56a491e14dfeafec746f'
  '57d90c89a221c52d78d0ec3953fe2fcf'
- 'd11d8bfbcf61330aa84d6dd9e93ca957')
+ '5e5b2ca4bea3dfcaed67eec07d152381')
 
 prepare() {
   cd dkms

Modified: hook.sh
===
--- hook.sh 2016-03-12 18:39:34 UTC (rev 261384)
+++ hook.sh 2016-03-12 18:46:53 UTC (rev 261385)
@@ -40,7 +40,7 @@
 # $*: dkms args
 do_module() {
local modname="$1"; shift
-   local modver="$2"; shift
+   local modver="$1"; shift
pushd "$install_tree" >/dev/null
# do $@ for each kernel with headers for $modname v$modver
local path


[arch-commits] Commit in dkms/trunk (PKGBUILD hook.sh)

2016-03-06 Thread Sébastien Luttringer
Date: Sunday, March 6, 2016 @ 14:22:06
  Author: seblu
Revision: 261109

upgpkg: dkms 2.2.0.3+git151023-6

- fix FS#48355

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.sh

--+
 PKGBUILD |4 ++--
 hook.sh  |   14 --
 2 files changed, 10 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2016-03-06 13:16:59 UTC (rev 261108)
+++ PKGBUILD2016-03-06 13:22:06 UTC (rev 261109)
@@ -4,7 +4,7 @@
 
 pkgname=dkms
 pkgver=2.2.0.3+git151023
-pkgrel=5
+pkgrel=6
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
 url='http://linux.dell.com/dkms/'
@@ -24,7 +24,7 @@
  '82d520c39c99c34977e48b313a189c6c'
  '8fe2064106958bcfd386e83494c8959a'
  '41fcecb1c2dfc59a4b648fddcd8b462f'
- '7fdc44f8ecdd0ac0dc5e6bcf02901681')
+ '22f9fc3633b13e548e78bcc48192d817')
 
 prepare() {
   cd dkms

Modified: hook.sh
===
--- hook.sh 2016-03-06 13:16:59 UTC (rev 261108)
+++ hook.sh 2016-03-06 13:22:06 UTC (rev 261109)
@@ -32,7 +32,6 @@
 # dkms path from framework config
 # note: the alpm hooks which trigger this script use static path
 source_tree='/usr/src'
-dkms_tree='/var/lib/dkms'
 install_tree='/usr/lib/modules'
 source /etc/dkms/framework.conf
 
@@ -48,13 +47,16 @@
done
popd >/dev/null
elif [[ "/$path" =~ ^$install_tree/([^/]+)/ ]]; then
-   # do $@ once for each registered dkms module
-   pushd "$dkms_tree" >/dev/null
-   for mod in */*/source; do
-   dkms "$@" -m "${mod%/source}" -k "${BASH_REMATCH[1]}"
+   kver="${BASH_REMATCH[1]}"
+   # do $@ once for each dkms module in $source_tree
+   for path in "$source_tree"/*-*/dkms.conf; do
+   if [[ "$path" =~ 
^$source_tree/([^/]+)-([^/]+)/dkms\.conf$ ]]; then
+   dkms "$@" -m "${BASH_REMATCH[1]}" -v 
"${BASH_REMATCH[2]}" -k "$kver"
+   fi
done
-   popd >/dev/null
else
echo "Skipping invalid path: $path" >&2
fi
 done
+
+true