Skip to content

Commit

Permalink
Fixed issue yadm-dev#455-lowercasing checks on both sides - More POSI…
Browse files Browse the repository at this point in the history
…X friendly 3
  • Loading branch information
erenfro committed May 31, 2023
1 parent a72c566 commit 8bfc09c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions yadm
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,17 @@ function score_file() {
return
fi
elif [[ "$label" =~ ^(d|distro)$ ]]; then
value=$(echo "$value" | "${AWK_PROGRAM[0]}" '{print tolower($0)}')
#value=$(echo "$value" | "${AWK_PROGRAM[0]}" '{print tolower($0)}') # FIXME Remove
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=$(echo "$value" | "${AWK_PROGRAM[0]}" '{print tolower($0)}')
#value=$(echo "$value" | "${AWK_PROGRAM[0]}" '{print tolower($0)}') # FIXME Remove
value=$("${AWK_PROGRAM[0]}" '{print tolower($0)}' <<<"$value")
if [ "${value/\ /_}" = "${local_distro_family/\ /_}" ]; then
score=$((score + 8))
else
Expand Down Expand Up @@ -1524,7 +1526,8 @@ function query_distro() {
fi
done < "$OS_RELEASE"
fi
echo "$distro" | "${AWK_PROGRAM[0]}" '{print tolower($0)}'
#echo "$distro" | "${AWK_PROGRAM[0]}" '{print tolower($0)}' ## FIXME Remove
"${AWK_PROGRAM[0]}" '{print tolower($0)}' <<<"$distro"
}

function query_distro_family() {
Expand All @@ -1541,7 +1544,8 @@ function query_distro_family() {
fi
done < "$OS_RELEASE"
fi
echo "$distro" | "${AWK_PROGRAM[0]}" '{print tolower($0)}'
#echo "$distro" | "${AWK_PROGRAM[0]}" '{print tolower($0)}' ## FIXME Remove
"${AWK_PROGRAM[0]}" '{print tolower($0)}' <<<"$distro"
}

function process_global_args() {
Expand Down

0 comments on commit 8bfc09c

Please sign in to comment.