From ec0fcc15d26268bfdd19324e92a45e8cb2fea1a2 Mon Sep 17 00:00:00 2001 From: FLGX Date: Sat, 15 Aug 2020 19:18:32 +0200 Subject: [PATCH] Allow using upper-cased "Y" to answer questions (#45) --- linux54-tkg/PKGBUILD | 2 +- linux54-tkg/linux54-tkg-config/prepare | 22 +++++++++++----------- linux57-tkg/install.sh | 2 +- linux57-tkg/linux57-tkg-config/prepare | 24 ++++++++++++------------ linux58-tkg/PKGBUILD | 6 +++--- linux58-tkg/linux58-tkg-config/prepare | 18 +++++++++--------- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/linux54-tkg/PKGBUILD b/linux54-tkg/PKGBUILD index 6df510d..f84cdec 100644 --- a/linux54-tkg/PKGBUILD +++ b/linux54-tkg/PKGBUILD @@ -78,7 +78,7 @@ else warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?" read -rp "`echo $' > N/y : '`" _fallback; fi - if [ "$_fallback" == "y" ] || [ "$_nofallback" == "true" ]; then + if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset else error "Exiting..." diff --git a/linux54-tkg/linux54-tkg-config/prepare b/linux54-tkg/linux54-tkg-config/prepare index 63999db..88833ce 100644 --- a/linux54-tkg/linux54-tkg-config/prepare +++ b/linux54-tkg/linux54-tkg-config/prepare @@ -9,7 +9,7 @@ user_patcher() { printf '%s\n' "${_patches[@]}" read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; fi - if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then + if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then for _f in "${_patches[@]}"; do if [ -e "${_f}" ]; then msg2 "######################################################" @@ -31,7 +31,7 @@ user_patcher() { printf '%s\n' "${_patches[@]}" read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; fi - if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then + if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then for _f in "${_patches[@]}"; do if [ -e "${_f}" ]; then msg2 "######################################################" @@ -467,7 +467,7 @@ _tkg_srcprep() { plain "and analyzing of kernel functions." read -rp "`echo $' > N/y : '`" CONDITION2; fi - if [ "$CONDITION2" == "y" ] || [ "$_ftracedisable" == "true" ]; then + if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" == "true" ]; then sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config fi @@ -479,7 +479,7 @@ _tkg_srcprep() { plain "https://bbs.archlinux.org/viewtopic.php?id=239174" read -rp "`echo $' > N/y : '`" CONDITION3; fi - if [ "$CONDITION3" == "y" ] || [ "$_numadisable" == "true" ]; then + if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" == "true" ]; then # disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ -i -e '/CONFIG_AMD_NUMA=y/d' \ @@ -533,7 +533,7 @@ _tkg_srcprep() { plain "and improve throughput on other schedulers (at the cost of latency)" read -rp "`echo $' > N/y : '`" CONDITION5; fi - if [ "$CONDITION5" == "y" ] || [ "$_voluntary_preempt" == "true" ]; then + if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" == "true" ]; then sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config @@ -545,7 +545,7 @@ _tkg_srcprep() { plain "Enable Device Tree and Open Firmware support?" read -rp "`echo $' > N/y : '`" CONDITION6; fi - if [ "$CONDITION6" == "y" ] || [ "$_OFenable" == "true" ]; then + if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" == "true" ]; then sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config fi @@ -556,7 +556,7 @@ _tkg_srcprep() { plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29" read -rp "`echo $' > N/y : '`" CONDITION7; fi - if [ "$CONDITION7" == "y" ] || [ "$_acs_override" == "true" ]; then + if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then patch -Np1 -i ../0006-add-acs-overrides_iommu.patch fi @@ -567,7 +567,7 @@ _tkg_srcprep() { # plain "https://bcachefs.org/" # read -rp "`echo $' > N/y : '`" CONDITION8; # fi -# if [ "$CONDITION8" == "y" ] || [ "$_bcachefs" == "true" ]; then +# if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then # patch -Np1 -i ../0008-5.4-bcachefs.patch # echo "CONFIG_BCACHEFS_FS=m" >> ./.config # echo "CONFIG_BCACHEFS_QUOTA=y" >> ./.config @@ -584,7 +584,7 @@ _tkg_srcprep() { plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305" read -rp "`echo $' > N/y : '`" CONDITION9; fi - if [ "$CONDITION9" == "y" ] || [ "$_fsync" == "true" ]; then + if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then patch -Np1 -i ../0007-v5.4-fsync.patch fi @@ -595,7 +595,7 @@ _tkg_srcprep() { plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch" read -rp "`echo $' > N/y : '`" CONDITION11; fi - if [ "$CONDITION11" == "y" ] || [ "$_zfsfix" == "true" ]; then + if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then patch -Np1 -i ../0011-ZFS-fix.patch fi @@ -637,7 +637,7 @@ _tkg_srcprep() { plain "!!!! Make sure to have a well populated db !!!!" read -rp "`echo $' > N/y : '`" CONDITIONMPDB; fi - if [ "$CONDITIONMPDB" == "y" ] || [ "$_modprobeddb" == "true" ]; then + if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" == "true" ]; then sudo modprobed-db recall make localmodconfig fi diff --git a/linux57-tkg/install.sh b/linux57-tkg/install.sh index fe78b58..db47755 100755 --- a/linux57-tkg/install.sh +++ b/linux57-tkg/install.sh @@ -147,7 +147,7 @@ if [ "$1" == "install" ]; then if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then msg2 "Building successfully finished!" read -p "Do you want to install the new Kernel ? y/[n]: " _install - if [ $_install == "y" ] || [ $_install == "Y" ] || [ $_install == "yes" ] || [ $_install == "Yes" ]; then + if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install == "yes" ] || [ $_install == "Yes" ]; then cd "$_where" _kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor _headers_deb=linux-headers-${_kernelname}*.deb diff --git a/linux57-tkg/linux57-tkg-config/prepare b/linux57-tkg/linux57-tkg-config/prepare index a04ec89..55906e4 100644 --- a/linux57-tkg/linux57-tkg-config/prepare +++ b/linux57-tkg/linux57-tkg-config/prepare @@ -57,7 +57,7 @@ _tkg_initscript() { warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?" read -rp "`echo $' > N/y : '`" _fallback; fi - if [ "$_fallback" == "y" ] || [ "$_nofallback" == "true" ]; then + if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset else error "Exiting..." @@ -77,7 +77,7 @@ user_patcher() { printf '%s\n' "${_patches[@]}" read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; fi - if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then + if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then for _f in "${_patches[@]}"; do if [ -e "${_f}" ]; then msg2 "######################################################" @@ -99,7 +99,7 @@ user_patcher() { printf '%s\n' "${_patches[@]}" read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; fi - if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then + if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then for _f in "${_patches[@]}"; do if [ -e "${_f}" ]; then msg2 "######################################################" @@ -610,7 +610,7 @@ _tkg_srcprep() { plain "and analyzing of kernel functions." read -rp "`echo $' > N/y : '`" CONDITION2; fi - if [ "$CONDITION2" == "y" ] || [ "$_ftracedisable" == "true" ]; then + if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" == "true" ]; then sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config fi @@ -622,7 +622,7 @@ _tkg_srcprep() { plain "https://bbs.archlinux.org/viewtopic.php?id=239174" read -rp "`echo $' > N/y : '`" CONDITION3; fi - if [ "$CONDITION3" == "y" ] || [ "$_numadisable" == "true" ]; then + if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" == "true" ]; then # disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ -i -e '/CONFIG_AMD_NUMA=y/d' \ @@ -689,7 +689,7 @@ _tkg_srcprep() { plain "and improve throughput on other schedulers (at the cost of latency)" read -rp "`echo $' > N/y : '`" CONDITION5; fi - if [ "$CONDITION5" == "y" ] || [ "$_voluntary_preempt" == "true" ]; then + if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" == "true" ]; then sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config @@ -701,7 +701,7 @@ _tkg_srcprep() { plain "Enable Device Tree and Open Firmware support?" read -rp "`echo $' > N/y : '`" CONDITION6; fi - if [ "$CONDITION6" == "y" ] || [ "$_OFenable" == "true" ]; then + if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" == "true" ]; then sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config fi @@ -712,7 +712,7 @@ _tkg_srcprep() { plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29" read -rp "`echo $' > N/y : '`" CONDITION7; fi - if [ "$CONDITION7" == "y" ] || [ "$_acs_override" == "true" ]; then + if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then msg2 "Patching ACS override" patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch fi @@ -724,7 +724,7 @@ _tkg_srcprep() { plain "https://bcachefs.org/" read -rp "`echo $' > N/y : '`" CONDITION8; fi - if [ "$CONDITION8" == "y" ] || [ "$_bcachefs" == "true" ]; then + if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then msg2 "Patching Bcache filesystem support override" patch -Np1 -i "$srcdir"/0008-5.7-bcachefs.patch @@ -743,7 +743,7 @@ _tkg_srcprep() { plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305" read -rp "`echo $' > N/y : '`" CONDITION9; fi - if [ "$CONDITION9" == "y" ] || [ "$_fsync" == "true" ]; then + if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then msg2 "Patching Fsync support" patch -Np1 -i "$srcdir"/0007-v5.7-fsync.patch fi @@ -755,7 +755,7 @@ _tkg_srcprep() { plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch" read -rp "`echo $' > N/y : '`" CONDITION11; fi - if [ "$CONDITION11" == "y" ] || [ "$_zfsfix" == "true" ]; then + if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then msg2 "Patching missing symbol for AES-NI/AVX support on ZFS" patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch fi @@ -800,7 +800,7 @@ _tkg_srcprep() { plain "!!!! Make sure to have a well populated db !!!!" read -rp "`echo $' > N/y : '`" CONDITIONMPDB; fi - if [ "$CONDITIONMPDB" == "y" ] || [ "$_modprobeddb" == "true" ]; then + if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" == "true" ]; then sudo modprobed-db recall make localmodconfig fi diff --git a/linux58-tkg/PKGBUILD b/linux58-tkg/PKGBUILD index becd537..093491d 100644 --- a/linux58-tkg/PKGBUILD +++ b/linux58-tkg/PKGBUILD @@ -76,7 +76,7 @@ else warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?" read -rp "`echo $' > N/y : '`" _fallback; fi - if [ "$_fallback" == "y" ] || [ "$_nofallback" == "true" ]; then + if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset else error "Exiting..." @@ -167,7 +167,7 @@ user_patcher() { printf '%s\n' "${_patches[@]}" read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; fi - if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then + if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then for _f in "${_patches[@]}"; do if [ -e "${_f}" ]; then msg2 "######################################################" @@ -189,7 +189,7 @@ user_patcher() { printf '%s\n' "${_patches[@]}" read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; fi - if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then + if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then for _f in "${_patches[@]}"; do if [ -e "${_f}" ]; then msg2 "######################################################" diff --git a/linux58-tkg/linux58-tkg-config/prepare b/linux58-tkg/linux58-tkg-config/prepare index 823fe1e..a83e9f5 100644 --- a/linux58-tkg/linux58-tkg-config/prepare +++ b/linux58-tkg/linux58-tkg-config/prepare @@ -454,7 +454,7 @@ _tkg_srcprep() { plain "and analyzing of kernel functions." read -rp "`echo $' > N/y : '`" CONDITION2; fi - if [ "$CONDITION2" == "y" ] || [ "$_ftracedisable" == "true" ]; then + if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" == "true" ]; then sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config fi @@ -466,7 +466,7 @@ _tkg_srcprep() { plain "https://bbs.archlinux.org/viewtopic.php?id=239174" read -rp "`echo $' > N/y : '`" CONDITION3; fi - if [ "$CONDITION3" == "y" ] || [ "$_numadisable" == "true" ]; then + if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" == "true" ]; then # disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ -i -e '/CONFIG_AMD_NUMA=y/d' \ @@ -533,7 +533,7 @@ _tkg_srcprep() { plain "and improve throughput on other schedulers (at the cost of latency)" read -rp "`echo $' > N/y : '`" CONDITION5; fi - if [ "$CONDITION5" == "y" ] || [ "$_voluntary_preempt" == "true" ]; then + if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" == "true" ]; then sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config @@ -545,7 +545,7 @@ _tkg_srcprep() { plain "Enable Device Tree and Open Firmware support?" read -rp "`echo $' > N/y : '`" CONDITION6; fi - if [ "$CONDITION6" == "y" ] || [ "$_OFenable" == "true" ]; then + if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" == "true" ]; then sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config fi @@ -556,7 +556,7 @@ _tkg_srcprep() { plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29" read -rp "`echo $' > N/y : '`" CONDITION7; fi - if [ "$CONDITION7" == "y" ] || [ "$_acs_override" == "true" ]; then + if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then patch -Np1 -i ../0006-add-acs-overrides_iommu.patch fi @@ -567,7 +567,7 @@ _tkg_srcprep() { # plain "https://bcachefs.org/" # read -rp "`echo $' > N/y : '`" CONDITION8; # fi -# if [ "$CONDITION8" == "y" ] || [ "$_bcachefs" == "true" ]; then +# if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then # patch -Np1 -i ../0008-5.8-bcachefs.patch # echo "CONFIG_BCACHEFS_FS=m" >> ./.config # echo "CONFIG_BCACHEFS_QUOTA=y" >> ./.config @@ -584,7 +584,7 @@ _tkg_srcprep() { plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305" read -rp "`echo $' > N/y : '`" CONDITION9; fi - if [ "$CONDITION9" == "y" ] || [ "$_fsync" == "true" ]; then + if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then patch -Np1 -i ../0007-v5.8-fsync.patch fi @@ -595,7 +595,7 @@ _tkg_srcprep() { plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch" read -rp "`echo $' > N/y : '`" CONDITION11; fi - if [ "$CONDITION11" == "y" ] || [ "$_zfsfix" == "true" ]; then + if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then patch -Np1 -i ../0011-ZFS-fix.patch fi @@ -637,7 +637,7 @@ _tkg_srcprep() { plain "!!!! Make sure to have a well populated db !!!!" read -rp "`echo $' > N/y : '`" CONDITIONMPDB; fi - if [ "$CONDITIONMPDB" == "y" ] || [ "$_modprobeddb" == "true" ]; then + if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" == "true" ]; then sudo modprobed-db recall make localmodconfig fi