[arch-projects] [mkinitcpio][PATCH 2/9] functions: refactor all_modules

Dave Reisner d at falconindy.com
Tue Jun 7 14:40:20 EDT 2011


On Tue, Jun 07, 2011 at 08:18:02PM +0200, Thomas Bächler wrote:
> Am 06.06.2011 22:02, schrieb Dave Reisner:
> > --- a/functions
> > +++ b/functions
> > @@ -52,11 +52,16 @@ auto_modules ()
> >  
> >  all_modules ()
> >  {
> > -    mods=$(find ${MODULEDIR} -name '*.ko' -or -name '*.ko.gz' 2>/dev/null | grep $@ | sort -u)
> > +    local -i count=0
> > +    while read -r -d '' mod; do
> > +        (( ++count ))
> > +        mod=${mod##*/}
> > +        mod="${mod%.ko.*}"
> > +        printf '%s\n' "${mod//-/_}"
> > +    done < <(find "$MODULEDIR" -name '*.ko*' -print0 2>/dev/null |
> > +        grep -Zz "$@" | sort -zu)
> 
> I don't understand this 'sort' call. You are sorting the file names
> before stripping the paths. The file names are always unique.
> 

You're right, this makes no sense. It's gone and pushed to my github
repo[1].

d

[1] git://github.com/falconindy/mkinitcpio.git



More information about the arch-projects mailing list