Replace < by -lt for _basever comparison. The comparison was always resulting in 54-59 being greater than 515.

Fixes https://github.com/Frogging-Family/linux-tkg/issues/450
This commit is contained in:
Tk-Glitch
2022-03-10 17:15:28 +01:00
parent 2a3190333c
commit a1d2d60beb

View File

@@ -324,7 +324,7 @@ _tkg_initscript() {
user_patcher() { user_patcher() {
for _f in "$_where"/*."${_userpatch_ext}patch" "$_where"/*."${_userpatch_ext}revert"; do for _f in "$_where"/*."${_userpatch_ext}patch" "$_where"/*."${_userpatch_ext}revert"; do
[ -e "${_f}" ] || continue [ -e "${_f}" ] || continue
warning "Found userpatch file ${f##*/} in the PKGBUILD directory." warning "Found userpatch file ${f##*/} in the PKGBUILD directory." #"
warning "Userpatches must now be placed in version-specific subdirectories (linux${_basever}-tkg-userpatches for this kernel version)." warning "Userpatches must now be placed in version-specific subdirectories (linux${_basever}-tkg-userpatches for this kernel version)."
warning "The patch will not be applied." warning "The patch will not be applied."
break break
@@ -385,7 +385,7 @@ _tkg_patcher() {
patch -Np1 -i "$tkgpatch" >> "$_where"/prepare.log || error "An error was encountered applying patches. It was logged to the prepare.log file." patch -Np1 -i "$tkgpatch" >> "$_where"/prepare.log || error "An error was encountered applying patches. It was logged to the prepare.log file."
echo -e "\n" >> "$_where"/prepare.log echo -e "\n" >> "$_where"/prepare.log
else else
msg2 "Skipping patch ${tkgpatch##*/}...\n (unavailable for this kernel version)" msg2 "Skipping patch ${tkgpatch##*/}...\n (unavailable for this kernel version)" #"
fi fi
} }
@@ -586,7 +586,7 @@ _tkg_srcprep() {
elif [ "${_cpusched}" = "cacule" ]; then elif [ "${_cpusched}" = "cacule" ]; then
_msg="Applying cacule patch" _msg="Applying cacule patch"
if [ "${_distro}" = "Void" ]; then if [ "${_distro}" = "Void" ]; then
if [[ $_basever < 515 ]]; then if [[ $_basever -lt 515 ]]; then
wget -P "$wrksrc" "https://raw.githubusercontent.com/hamadmarri/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch" wget -P "$wrksrc" "https://raw.githubusercontent.com/hamadmarri/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch"
elif [[ $_basever = 515 ]]; then elif [[ $_basever = 515 ]]; then
wget -P "$wrksrc" "https://raw.githubusercontent.com/CachyOS/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch" wget -P "$wrksrc" "https://raw.githubusercontent.com/CachyOS/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch"
@@ -595,7 +595,7 @@ _tkg_srcprep() {
fi fi
tkgpatch="$wrksrc/cacule-${_basekernel}.patch" && _tkg_patcher tkgpatch="$wrksrc/cacule-${_basekernel}.patch" && _tkg_patcher
else else
if [[ $_basever < 515 ]]; then if [[ $_basever -lt 515 ]]; then
wget -P "$srcdir" "https://raw.githubusercontent.com/hamadmarri/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch" wget -P "$srcdir" "https://raw.githubusercontent.com/hamadmarri/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch"
elif [[ $_basever = 515 ]]; then elif [[ $_basever = 515 ]]; then
wget -P "$srcdir" "https://raw.githubusercontent.com/CachyOS/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch" wget -P "$srcdir" "https://raw.githubusercontent.com/CachyOS/cacule-cpu-scheduler/master/patches/CacULE/v${_basekernel}/cacule-${_basekernel}.patch"
@@ -1405,11 +1405,11 @@ CONFIG_DEBUG_INFO_BTF_MODULES=y\r
mapfile -d '' -t fragments < <(find "$_where"/ -type f -name "*.myfrag" -print0) mapfile -d '' -t fragments < <(find "$_where"/ -type f -name "*.myfrag" -print0)
if [ true = "$_config_fragments_no_confirm" ]; then if [ true = "$_config_fragments_no_confirm" ]; then
printf 'Using config fragment %s\n' "${fragments[@]#$_where/}" printf 'Using config fragment %s\n' "${fragments[@]#$_where/}" #"
else else
for i in "${!fragments[@]}"; do for i in "${!fragments[@]}"; do
while true; do while true; do
read -r -p 'Found config fragment '"${fragments[$i]#$_where/}"', apply it? [y/N] ' CONDITIONMPDB read -r -p 'Found config fragment '"${fragments[$i]#$_where/}"', apply it? [y/N] ' CONDITIONMPDB #"
CONDITIONMPDB="$(printf '%s' "$CONDITIONMPDB" | tr '[:upper:]' '[:lower:]')" CONDITIONMPDB="$(printf '%s' "$CONDITIONMPDB" | tr '[:upper:]' '[:lower:]')"
case "$CONDITIONMPDB" in case "$CONDITIONMPDB" in
y|yes) y|yes)