From 48779980ad3c9a1bbd8a4b4e476fc34501ec196e Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 17:56:35 -0500 Subject: [PATCH] fix: fix apt version handling to fix gcc --- src/utils/setup/setupAptPack.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/setup/setupAptPack.ts b/src/utils/setup/setupAptPack.ts index 5313be29..e375a781 100644 --- a/src/utils/setup/setupAptPack.ts +++ b/src/utils/setup/setupAptPack.ts @@ -24,7 +24,15 @@ export async function setupAptPack( didUpdate = true } - exit = await exec(apt, ["install", version !== undefined && version !== "" ? `${name}=${version}` : name]) + if (version !== undefined && version !== "") { + try { + exit = await exec(apt, ["install", `${name}=${version}`]) + } catch { + exit = await exec(apt, ["install", `${name}-${version}`]) + } + } else { + exit = await exec(apt, ["install", name]) + } if (exit !== 0) { throw new Error(`Failed to install ${name} ${version}`)