mirror of https://github.com/aminya/setup-cpp.git
fix: do not use root for apk update
This commit is contained in:
parent
5a0bbafcb2
commit
ba81f6ae16
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
|
|
@ -29,8 +29,7 @@
|
|||
"ci-log": "workspace:*",
|
||||
"envosman": "workspace:*",
|
||||
"which": "4.0.0",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"node-downloader-helper": "2.1.9",
|
||||
"execa": "7.2.0",
|
||||
"memoizee": "^0.4.17"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
import { defaultExecOptions, execRootSync } from "admina"
|
||||
import memoize from "memoizee"
|
||||
import { filterAndQualifyApkPackages } from "./qualify-install.js"
|
||||
import { updateApkMemoized } from "./update.js"
|
||||
|
||||
/** Install bash (usually missing from docker containers) */
|
||||
export async function initApk() {
|
||||
// Update the repos
|
||||
await updateApkMemoized()
|
||||
|
||||
const toInstall = await filterAndQualifyApkPackages([
|
||||
{ name: "bash" },
|
||||
])
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ export async function installApkPackage(packages: ApkPackage[], update = false):
|
|||
try {
|
||||
// Update package index if requested
|
||||
|
||||
// init the apk
|
||||
await initApkMemoized()
|
||||
|
||||
if (update) {
|
||||
// Force update the repos
|
||||
await updateApkMemoized.clear()
|
||||
|
|
@ -39,9 +42,6 @@ export async function installApkPackage(packages: ApkPackage[], update = false):
|
|||
// Update the repos if needed
|
||||
await updateApkMemoized()
|
||||
|
||||
// init the apk
|
||||
await initApkMemoized()
|
||||
|
||||
const packagesToInstall = await filterAndQualifyApkPackages(packages)
|
||||
|
||||
if (packagesToInstall.length === 0) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { execRoot } from "admina"
|
||||
import { execa } from "execa"
|
||||
import memoizee from "memoizee"
|
||||
|
||||
async function updateApk() {
|
||||
await execRoot("apk", ["update"], { stdio: "inherit" })
|
||||
await execa("apk", ["update"], { stdio: "inherit" })
|
||||
}
|
||||
export const updateApkMemoized = memoizee(updateApk, { promise: true })
|
||||
|
|
|
|||
|
|
@ -384,15 +384,12 @@ importers:
|
|||
envosman:
|
||||
specifier: workspace:*
|
||||
version: link:../envosman
|
||||
escape-string-regexp:
|
||||
specifier: ^5.0.0
|
||||
version: 5.0.0
|
||||
execa:
|
||||
specifier: 7.2.0
|
||||
version: 7.2.0
|
||||
memoizee:
|
||||
specifier: ^0.4.17
|
||||
version: 0.4.17
|
||||
node-downloader-helper:
|
||||
specifier: 2.1.9
|
||||
version: 2.1.9
|
||||
path-exists:
|
||||
specifier: ^5.0.0
|
||||
version: 5.0.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue