Skip to content

Commit 4e7c4bb

Browse files
committed
fix: install nala via default repo or installer
1 parent 61855cf commit 4e7c4bb

File tree

12 files changed

+205
-115
lines changed

12 files changed

+205
-115
lines changed

dist/actions/setup-cpp.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/setup-apt/README.md

Lines changed: 94 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,34 @@ Add the update-alternatives command to the rc file
4646

4747
**returns:** Promise<void>
4848

49+
### `getAptEnv` (function)
50+
51+
Get the environment variables to use for the apt command
52+
53+
**Parameters:**
54+
55+
- apt (`string`) - The apt command to use
56+
57+
**returns:** ProcessEnv
58+
59+
### `aptTimeout` (variable)
60+
61+
The timeout to use for apt commands
62+
Wait up to 300 seconds if the apt-get lock is held
63+
64+
### `hasNala` (function)
65+
66+
Check if nala is installed
67+
68+
**returns:** boolean
69+
70+
### `getApt` (function)
71+
72+
Get the apt command to use
73+
If nala is installed, use that, otherwise use apt-get
74+
75+
**returns:** string
76+
4977
### `isAptPackInstalled` (function)
5078

5179
Check if a package is installed
@@ -66,6 +94,8 @@ Check if a package matching a regexp is installed
6694

6795
**returns:** Promise<boolean>
6896

97+
### `updatedRepos` (variable)
98+
6999
### `updateAptRepos` (function)
70100

71101
Update the apt repositories
@@ -76,14 +106,72 @@ Update the apt repositories
76106

77107
**returns:** void
78108

79-
### `InstallationInfo` (type)
109+
### `updateAptReposMemoized` (variable)
80110

81-
The information about an installation result
111+
Update the apt repositories (memoized)
82112

83-
### `aptTimeout` (variable)
113+
**Parameters:**
84114

85-
The timeout to use for apt commands
86-
Wait up to 300 seconds if the apt-get lock is held
115+
- apt - The apt command to use (optional)
116+
117+
### `filterAndQualifyAptPackages` (function)
118+
119+
Filter out the packages that are already installed and qualify the packages into a full package name/version
120+
121+
**Parameters:**
122+
123+
- packages (`AptPackage[]`)
124+
- apt (`string`)
125+
126+
**returns:** Promise<string[]>
127+
128+
### `qualifiedNeededAptPackage` (function)
129+
130+
Qualify the package into full package name/version.
131+
If the package is not installed, return the full package name/version.
132+
If the package is already installed, return undefined
133+
134+
**Parameters:**
135+
136+
- pack (`AptPackage`)
137+
- apt (`string`)
138+
139+
**returns:** Promise<string>
140+
141+
### `initApt` (function)
142+
143+
Install gnupg and certificates (usually missing from docker containers)
144+
145+
**Parameters:**
146+
147+
- apt (`string`)
148+
149+
**returns:** Promise<void>
150+
151+
### `initAptMemoized` (variable)
152+
153+
Install gnupg and certificates (usually missing from docker containers) (memoized)
154+
155+
### `addAptRepository` (function)
156+
157+
**Parameters:**
158+
159+
- repo (`string`)
160+
- apt (`string`)
161+
162+
**returns:** Promise<void>
163+
164+
### `installAddAptRepo` (function)
165+
166+
**Parameters:**
167+
168+
- apt (`string`)
169+
170+
**returns:** Promise<void>
171+
172+
### `InstallationInfo` (type)
173+
174+
The information about an installation result
87175

88176
### `AptPackage` (type)
89177

@@ -115,29 +203,6 @@ await installAptPack([
115203
])
116204
```
117205

118-
### `hasNala` (function)
119-
120-
Check if nala is installed
121-
122-
**returns:** boolean
123-
124-
### `getApt` (function)
125-
126-
Get the apt command to use
127-
If nala is installed, use that, otherwise use apt-get
128-
129-
**returns:** string
130-
131-
### `getAptEnv` (function)
132-
133-
Get the environment variables to use for the apt command
134-
135-
**Parameters:**
136-
137-
- apt (`string`) - The apt command to use
138-
139-
**returns:** ProcessEnv
140-
141206
### `AddAptKeyOptions` (type)
142207

143208
### `addAptKey` (function)
@@ -151,10 +216,7 @@ Add an apt key
151216
**returns:** Promise<string>
152217

153218
```ts
154-
await addAptKey({
155-
key: "3B4FE6ACC0B21F32"
156-
fileName: "bazel-archive-keyring.gpg",
157-
})
219+
await addAptKey({ key: "3B4FE6ACC0B21F32" fileName: "bazel-archive-keyring.gpg"})
158220
```
159221

160222
```ts

packages/setup-apt/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export * from "./get-apt.js"
66
export * from "./init-apt.js"
77
export * from "./install.js"
88
export * from "./is-installed.js"
9+
export * from "./qualify-install.js"
910
export * from "./update.js"

packages/setup-apt/src/init-apt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export async function initApt(apt: string) {
1010
// Update the repos
1111
updateAptReposMemoized(apt)
1212

13-
const toInstall = await filterAndQualifyAptPackages(apt, [
13+
const toInstall = await filterAndQualifyAptPackages([
1414
{ name: "ca-certificates" },
1515
{ name: "gnupg" },
1616
{ name: "apt-utils" },
17-
])
17+
], apt)
1818

1919
if (toInstall.length !== 0) {
2020
execRootSync(apt, ["install", "-y", "--fix-broken", "-o", aptTimeout, ...toInstall], {

packages/setup-apt/src/install.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function installAptPack(packages: AptPackage[], update = false): Pr
8282
// Add the repos if needed
8383
await addRepositories(apt, packages)
8484

85-
const needToInstall = await filterAndQualifyAptPackages(apt, packages)
85+
const needToInstall = await filterAndQualifyAptPackages(packages, apt)
8686

8787
if (needToInstall.length === 0) {
8888
info("All packages are already installed")

0 commit comments

Comments
 (0)