modalias.prov: change interpreter to /bin/bash -efu
* modalias.prov: Chnge interpreter from "/bin/sh" to "/bin/bash" because it uses bashisms; add "-efu" flags to keep things in check; initialise is_kernel_package variable; check for presence of /sbin/modinfo, sed, and sort. (combine_modaliases): Initialise the "variants" and "pos" variables. Resolves: #2002887 Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
parent
1208dd48a6
commit
52ba5a74f2
@ -1,4 +1,4 @@
|
||||
#! /bin/sh
|
||||
#! /bin/bash -efu
|
||||
|
||||
# heavily based upon find-suggests.ksyms by Andreas Gruenbacher <agruen@suse.de>.
|
||||
# with modifications by Michael Brown <Michael_E_Brown@dell.com>
|
||||
@ -14,7 +14,8 @@ IFS=$'\n'
|
||||
# completeness, so that we can determine when drivers are folded into
|
||||
# mainline kernel.
|
||||
#
|
||||
case "$1" in
|
||||
is_kernel_package=""
|
||||
case "${1:-}" in
|
||||
kernel-module-*) ;; # Fedora kernel module package names start with
|
||||
# kernel-module.
|
||||
kernel*) is_kernel_package=1 ;;
|
||||
@ -25,6 +26,11 @@ if ! [ -z "$is_kernel_package" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check for presence of the commands used
|
||||
which /sbin/modinfo >/dev/null || exit 0
|
||||
which sed >/dev/null || exit 0
|
||||
which sort >/dev/null || exit 0
|
||||
|
||||
print_modaliases() {
|
||||
declare class=$1 variants=$2 pos=$3
|
||||
if [ -n "$variants" ]; then
|
||||
@ -35,7 +41,7 @@ print_modaliases() {
|
||||
}
|
||||
|
||||
combine_modaliases() {
|
||||
declare tag class variants pos n
|
||||
declare tag class variants="" pos="" n
|
||||
read class
|
||||
while read tag; do
|
||||
for ((n=0; n<${#class}; n++)); do
|
||||
|
Loading…
Reference in New Issue
Block a user