Skip to content

Commit 1193453

Browse files
committed
fix: first try gcc installation without the ppa
1 parent b8c9910 commit 1193453

File tree

5 files changed

+33
-19
lines changed

5 files changed

+33
-19
lines changed

dist/legacy/setup-cpp.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

+1-1
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

+1-1
Large diffs are not rendered by default.

src/gcc/gcc.ts

+29-15
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,35 @@ export async function setupGcc(version: string, setupDir: string, arch: string,
5050
// the default version
5151
installationInfo = await installAptPack([{ name: "gcc" }, { name: "g++" }])
5252
} else {
53-
// add the PPA for access to more versions
54-
installationInfo = await installAptPack([
55-
{
56-
name: "gcc",
57-
version,
58-
repository: "ppa:ubuntu-toolchain-r/test",
59-
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
60-
},
61-
{
62-
name: "g++",
63-
version,
64-
repository: "ppa:ubuntu-toolchain-r/test",
65-
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
66-
},
67-
])
53+
try {
54+
// first try to install the version from the default repository
55+
installationInfo = await installAptPack([
56+
{
57+
name: "gcc",
58+
version,
59+
},
60+
{
61+
name: "g++",
62+
version,
63+
},
64+
])
65+
} catch (err) {
66+
// add the PPA for access to more versions
67+
installationInfo = await installAptPack([
68+
{
69+
name: "gcc",
70+
version,
71+
repository: "ppa:ubuntu-toolchain-r/test",
72+
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
73+
},
74+
{
75+
name: "g++",
76+
version,
77+
repository: "ppa:ubuntu-toolchain-r/test",
78+
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
79+
},
80+
])
81+
}
6882
}
6983
}
7084
// if (arch !== "x64") {

0 commit comments

Comments
 (0)