On Fri, 13 Nov 2020 21:12:19 -0000, GitLab Bridge on behalf of bcrocker wrote:
> -if [ -f $RpmDir/$ModDir/extra/drivers/block/floppy.ko* ]; then
> -     blacklist "floppy"
> -fi

Since the script is /bin/bash, just use [[ ]]. You will not have to
worry about the glob matching multiple files. You will also not have to
worry about quoting the variables. It's much simpler and easier to
understood than the for loop.

> +for f in "$RpmDir/$ModDir"/extra/drivers/block/floppy.ko*
> +do
> +    # This unnecessary if-stmt prevents an "unused variable"
> +    # warning from shellcheck:

But if you go with the for loop anyway, please fix this comment. The if
is fundamental, floppy would be unconditionally blacklisted otherwise.
If there's no floppy.ko, the loop will still execute with the glob
itself (unless nullglob is set but it's usually not).

> +    if [ -e "$f" ]
> +    then
> +        blacklist "floppy"
> +        break
> +    fi
> +done

 Jiri
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]

Reply via email to