Skip to content

Commit

Permalink
Merge pull request #456 from erenfro/master
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLocehiliosan committed Aug 5, 2023
2 parents 76ce3de + 9f852c1 commit fdfff94
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit fdfff94

Please sign in to comment.