Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Train fix: the rpm hand-off test removes the folders it made; its comment matches the order it runs

milind-soni09ee6d751fc1
diff --git a/electron/package-install-command.mjs b/electron/package-install-command.mjs
index 7476dcff7a..bc97fc820b 100644
--- a/electron/package-install-command.mjs
+++ b/electron/package-install-command.mjs
@@ -26,7 +26,7 @@ const BUILDERS = {
// apt-get, never `dpkg -i`: only apt-get resolves dependencies, and Ubuntu satisfies ours through virtual Provides.
deb: (file) => `sudo apt-get install -y ${file}`,
// dnf (then yum, zypper), never bare `rpm -Uvh`: rpm installs nothing when a dependency is missing and leaves
- // the package out of the package manager's own database, so the next update conflicts. Same pick order as
+ // the package out of the package manager's own database, so the next update conflicts. The same commands as
// electron-updater's RpmUpdater; the file rides as $0 so the quoted path survives the inner shell too.
rpm: (file) =>
`sudo sh -c 'if command -v dnf >/dev/null 2>&1; then exec dnf install --nogpgcheck -y "$0"; ` +
diff --git a/electron/package-install-command.node-test.mjs b/electron/package-install-command.node-test.mjs
index 789ec80c10..0737270311 100644
--- a/electron/package-install-command.node-test.mjs
+++ b/electron/package-install-command.node-test.mjs
@@ -106,8 +106,10 @@ test("the rpm command picks a dependency-resolving package manager and passes on
// Fake package managers on PATH announce themselves and print their arguments; a bare rpm would resolve
// nothing, so the fallback branch must never run here.
+ const bins = [];
const fakeBin = (present) => {
const bin = mkdtempSync(join(tmpdir(), "omb-rpm-pm-"));
+ bins.push(bin);
for (const name of present) {
writeFileSync(
join(bin, name),
@@ -136,11 +138,10 @@ test("the rpm command picks a dependency-resolving package manager and passes on
out = run(fakeBin(["zypper", "rpm"]));
assert.deepEqual(out.slice(-7), ["PM-zypper", "--non-interactive", "--no-refresh", "install", "--allow-unsigned-rpm", "-f", file]);
} finally {
- rmSync(join(tmpdir(), "omb-rpm-pm-"), { recursive: true, force: true });
+ for (const bin of bins) rmSync(bin, { recursive: true, force: true });
}
});
-
test("the package marker decides the install path", () => {
const marker = (declared) => (file) => (file.endsWith("package-type") ? declared : null);