update-kernel: Sanitize some variables

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Виталий Чикунов 2022-04-09 10:49:44 +03:00
parent 92192ef950
commit 240e64218c

View File

@ -90,6 +90,17 @@ ufver() {
echo "$v"
}
all=
dryrun=
force=
headers=
interactive=
kernel_flavour=
list=
reinstall=
release=
verbose=
#parse command line options
TEMP=$(getopt -n "$PROG" -o a,i,l,f,y,t:,r:,v,n,h -l interactive,list,all,force,type:,release:,verbose,reinstall,dry-run,headers,help -- "$@") || show_help
eval set -- "$TEMP"
@ -277,7 +288,7 @@ if [[ "$release" =~ ^[0-9]+\.[0-9.]+-.*-[^-]+$ ]]; then
fi
kernel_flavour="$flv"
release="$ver-$rel"
ver='' flv='' rel=''
unset ver flv rel
elif [[ "$release" =~ ^(kernel-image-)?.*[-=#][0-9:]+\.[0-9.]+-[^-]+$ ]]; then
# Rewrite release in RPM, APT package format
ver="${release#kernel-image-}"
@ -288,7 +299,7 @@ elif [[ "$release" =~ ^(kernel-image-)?.*[-=#][0-9:]+\.[0-9.]+-[^-]+$ ]]; then
fi
kernel_flavour="$flv"
release="$rel"
ver='' flv='' rel=''
unset ver flv rel
fi
# set kernel flavour. if not defined with -t option, use current