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

Thomas Bächler thomas at archlinux.org
Tue Jun 7 14:18:02 EDT 2011


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-projects/attachments/20110607/065b9bad/attachment-0001.asc>


More information about the arch-projects mailing list