From: Michal J. <mi...@ha...> - 2004-08-11 22:42:50
|
On Wed, Aug 11, 2004 at 08:08:05AM -0600, er...@he... wrote: > On Tue, Aug 10, 2004 at 03:26:37PM -0600, Michal Jaegermann wrote: .... > > > > which could be simply rewritten as .... > > making all this recursion unnecessary (and skirting the bug in the > > process). > > Sounds good to me. I'll take the simple road. In that case, after some thought, I think that the following will be safe and will work not only with the current kernel: --- ./beoboot.orig 2004-07-15 22:49:45.000000000 -0600 +++ ./beoboot 2004-08-11 16:21:46.015934024 -0600 @@ -169,15 +169,8 @@ # module. # module_dep() { - local MODDIR="$1" - local MOD="$2" - local DEPS= - local dep - DEPS=`module_expand $MODDIR \`$BEOLIB/bin/modhelper -d "$MOD"\`` - for dep in $DEPS; do - echo "$dep" - module_dep "$MODDIR" "$dep" - done + depmod --quick $KVER + sed -n 's!'"$2"': *!!p' "$1/modules.dep" } > I'm glad they got rid of those @#!$ stupid newline escapes in > modules.dep. Oh, in such situation module_dep () { local line depmod --quick $KVER while read line ; do case $line in "$2: "*) echo "${line#*: }" ; break ;; esac done < "$1/modules.dep" } will do just fine as 'read' above will handle escapes by itself. And not even sed is required. :-) Maybe this is even better in some sense then that version with sed? Well, yes, there is a quiet assumption here that modules are already installed. I do not think that this is too much to ask in practice. Michal |