Small regexp bugfixes
This commit is contained in:
parent
9ae7ffb8c9
commit
54d71ef32f
@ -424,12 +424,12 @@ find_toolchain()
|
||||
local dist=10
|
||||
local toolchain=""
|
||||
# extract target major.minor version from expression
|
||||
local target_ver=$(grep -oE "[[:digit:]].[[:digit:]]" <<< "$expression")
|
||||
local target_ver=$(grep -oE "[[:digit:]]+\.[[:digit:]]+" <<< "$expression")
|
||||
for dir in $SRC/cache/toolchains/*/; do
|
||||
# check if is a toolchain for current $ARCH
|
||||
[[ ! -f ${dir}bin/${compiler}gcc ]] && continue
|
||||
# get toolchain major.minor version
|
||||
local gcc_ver=$(${dir}bin/${compiler}gcc -dumpversion | grep -oE "^[[:digit:]].[[:digit:]]")
|
||||
local gcc_ver=$(${dir}bin/${compiler}gcc -dumpversion | grep -oE "^[[:digit:]]+\.[[:digit:]]+")
|
||||
# check if toolchain version satisfies requirement
|
||||
awk "BEGIN{exit ! ($gcc_ver $expression)}" >/dev/null || continue
|
||||
# check if found version is the closest to target
|
||||
|
||||
@ -93,7 +93,7 @@ do_expand_partition()
|
||||
echo -e "\n### [firstrun] ${ResizeLog}. Start resizing Partition now:\n" >>${Log}
|
||||
cat /proc/partitions >>${Log}
|
||||
echo -e "\nExecuting fdisk, fsck and partprobe:" >>${Log}
|
||||
local fdisk_version=$(fdisk --version | awk '{print $NF}' | grep -oE "^[[:digit:]].[[:digit:]]+")
|
||||
local fdisk_version=$(fdisk --version | awk '{print $NF}' | grep -oE "^[[:digit:]]\.[[:digit:]]+")
|
||||
if [[ $partitions == 1 ]] && awk "BEGIN{exit ! ($fdisk_version >= 2.27 )}"; then
|
||||
# if dealing with fdisk from util-linux 2.27+ we need a workaround for just 1 partition
|
||||
# though it does not break anything - just prevents an "unexpected command" to fdisk
|
||||
|
||||
@ -86,7 +86,7 @@ function ambienttemp() {
|
||||
;;
|
||||
*)
|
||||
amb_temp=$(awk '{print $NF}' <<<$amb_temp | sed 's/C//g')
|
||||
echo -n "scale=1;${amb_temp}/1" | grep -oE "\-?[[:digit:]]+.[[:digit:]]"
|
||||
echo -n "scale=1;${amb_temp}/1" | grep -oE "\-?[[:digit:]]+\.[[:digit:]]"
|
||||
esac
|
||||
} # ambienttemp
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user