-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add new toolchain release 10.3-2021.07 #26
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
const versions: {[key: string]: string} = { | ||
'10.3-2021.07': | ||
'https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-${ARCH_OS}${MAC_EXTRA_OS}.${EXT}', | ||
'10-2020-q4': | ||
'https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-${ARCH_OS}.${EXT}', | ||
'9-2020-q2': | ||
|
@@ -67,11 +69,13 @@ export function distributionUrl(version: string, platform: string): string { | |
let archOs: string | ||
let ext: string | ||
let winExtraExt = '' | ||
let macExtraOS = '' | ||
switch (platform) { | ||
case 'darwin': | ||
osName = 'mac' | ||
archOs = 'mac' | ||
ext = 'tar.bz2' | ||
macExtraOS = '-10.14.6' | ||
break | ||
case 'linux': | ||
osName = 'linux' | ||
|
@@ -87,8 +91,7 @@ export function distributionUrl(version: string, platform: string): string { | |
default: | ||
throw new Error(`platform ${platform} is not supported`) | ||
} | ||
const parts = version.split('-') | ||
if (parts.length !== 3) { | ||
Comment on lines
-90
to
-91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the version string now only contains two It looks to me that thiss was basically checking if the version inputted by the user was valid, so I've replaced it with a check for the key in the |
||
if (!versions.hasOwnProperty(version)) { | ||
throw new Error(`invalid version ${version}. Available: ${availableVersions()}`) | ||
} | ||
// Try platform specific URL first | ||
|
@@ -109,6 +112,8 @@ export function distributionUrl(version: string, platform: string): string { | |
return ext | ||
case 'WIN_EXTRA_EXT': | ||
return winExtraExt | ||
case 'MAC_EXTRA_OS': | ||
return macExtraOS | ||
} | ||
throw new Error(`unknown replacement ${p1}`) | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ function urlExt(s: string): string { | |
const components = u.path?.split('/') | ||
if (components && components?.length > 0) { | ||
const last = components[components?.length - 1] | ||
const dot = last.indexOf('.') | ||
const dot = last.lastIndexOf('.') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the version format contains dots ( This also required a change in the switch case below to match |
||
if (dot >= 0) { | ||
return last.substr(dot).toLowerCase() | ||
} | ||
|
@@ -43,7 +43,7 @@ async function retryInstall(maxRetries: number, release: string, directory: stri | |
extractor = unzipper.Extract({path: directory}) | ||
resp.body.pipe(extractor) | ||
break | ||
case '.tar.bz2': | ||
case '.bz2': | ||
extractor = tar.x({strip: 1, C: directory}) | ||
resp.body.pipe(bz2()).pipe(extractor) | ||
break | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The macOS download now contains the OS version (I assume used to build GCC) in the filename, so
${MAC_EXTRA_OS}
has been added to the URL to be replaced.