Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #455-lowercasing checks on both sides #456

Closed
wants to merge 6 commits into from
9 changes: 7 additions & 2 deletions yadm
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,15 @@ function score_file() {
return
fi
elif [[ "$label" =~ ^(d|distro)$ ]]; then
value=$("${AWK_PROGRAM[0]}" '{print tolower($0)}' <<<"$value")
if [ "${value/\ /_}" = "${local_distro/\ /_}" ]; then
score=$((score + 4))
else
score=0
return
fi
elif [[ "$label" =~ ^(f|distro_family)$ ]]; then
value=$("${AWK_PROGRAM[0]}" '{print tolower($0)}' <<<"$value")
if [ "${value/\ /_}" = "${local_distro_family/\ /_}" ]; then
score=$((score + 8))
else
Expand Down Expand Up @@ -1522,7 +1524,7 @@ function query_distro() {
fi
done < "$OS_RELEASE"
fi
echo "$distro"
"${AWK_PROGRAM[0]}" '{print tolower($0)}' <<<"$distro"
}

function query_distro_family() {
Expand All @@ -1533,10 +1535,13 @@ function query_distro_family() {
family="${line#ID_LIKE=}"
family="${family//\"}"
break
elif [[ -z "$family" && "$line" = ID=* ]]; then
family="${line#ID=}"
family="${family//\"}"
fi
done < "$OS_RELEASE"
fi
echo "$family"
"${AWK_PROGRAM[0]}" '{print tolower($0)}' <<<"$distro"
}

function process_global_args() {
Expand Down