mirror of https://github.com/aminya/setup-cpp
fix: fix apt-cache show and use gcc 11 on Ubuntu 20
This commit is contained in:
parent
fbb91d5a68
commit
9c18ad87a1
|
@ -12,6 +12,8 @@ ignorePaths:
|
|||
words:
|
||||
- aarch
|
||||
- clangd
|
||||
- Trofimovich
|
||||
- cobertura
|
||||
- aminya
|
||||
- applellvm
|
||||
- bazel
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -67,11 +67,15 @@ async function getAptArg(name: string, version: string | undefined) {
|
|||
if (stdout.trim() !== "") {
|
||||
return `${name}-${version}`
|
||||
} else {
|
||||
try {
|
||||
// check if apt-get show can find the version
|
||||
const { stdout: showStdout } = await execa("apt-cache", ["show", `${name}=${version}`])
|
||||
if (showStdout.trim() === "") {
|
||||
return `${name}=${version}`
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
warning(`Failed to install ${name} ${version} via apt, trying without version`)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ export const DefaultVersions: Record<string, string> = {
|
|||
export const DefaultLinuxVersion: Record<string, Record<number, string>> = {
|
||||
gcc: {
|
||||
22: "13",
|
||||
20: "13",
|
||||
20: "11",
|
||||
18: "11",
|
||||
16: "11",
|
||||
14: "11",
|
||||
|
|
Loading…
Reference in New Issue