Skip to content

Commit

Permalink
Treat month as decimal instead of octal (#14985)
Browse files Browse the repository at this point in the history
With `-` we make sure to drop the leading `0` that is interpreted as octal number in calculations when running as a pure Unix shell script (which we use in mono component build).
  • Loading branch information
am11 committed Aug 1, 2024
1 parent 4f5a4ad commit a3dae8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eng/common/native/init-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case "$compiler" in
majorVersion="${version%%.*}"

# LLVM based on v18 released in early 2024, with two releases per year
maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 6)))"
maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))"
compiler=clang
;;

Expand All @@ -31,7 +31,7 @@ case "$compiler" in
majorVersion="${version%%.*}"

# GCC based on v14 released in early 2024, with one release per year
maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 12)))"
maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))"
compiler=gcc
;;
esac
Expand Down

0 comments on commit a3dae8d

Please sign in to comment.