Skip to content

Commit

Permalink
setup-r: no need to install qpdf, it is in rtools
Browse files Browse the repository at this point in the history
All version, afaict.
  • Loading branch information
gaborcsardi committed Mar 29, 2024
1 parent c878b1d commit 7171bbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
16 changes: 0 additions & 16 deletions setup-r/lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,6 @@ function acquireR(version) {
// version.rtools_cersion is always trithy on Windows, but typescript
// does not know that
if (IS_WINDOWS && version.rtools) {
const rtoolsVersionNumber = parseInt(version.rtools);
try {
yield acquireQpdfWindows();
}
catch (error) {
throw "Failed to get qpdf.";
}
try {
yield acquireGsWindows();
}
Expand Down Expand Up @@ -593,15 +586,6 @@ function acquireRtools(version) {
}
});
}
function acquireQpdfWindows() {
return __awaiter(this, void 0, void 0, function* () {
yield core.group("Downloading and installing qpdf", () => __awaiter(this, void 0, void 0, function* () {
const dlpath = yield tc.downloadTool("https://github.com/r-lib/actions/releases/download/sysreqs0/qpdf.nupkg");
yield io.mv(dlpath, path.join(tempDirectory, "qpdf.nupkg"));
yield exec.exec("choco", ["install", "qpdf", "--source", tempDirectory]);
}));
});
}
function acquireGsWindows() {
return __awaiter(this, void 0, void 0, function* () {
yield core.group("Downloading and installing Ghostscript", () => __awaiter(this, void 0, void 0, function* () {
Expand Down
21 changes: 2 additions & 19 deletions setup-r/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,16 @@ async function acquireR(version: IRVersion) {
// version.rtools_cersion is always trithy on Windows, but typescript
// does not know that
if (IS_WINDOWS && version.rtools) {
const rtoolsVersionNumber = parseInt(version.rtools);
try {
await acquireQpdfWindows();
} catch (error) {
throw "Failed to get qpdf."
}
try {
await acquireGsWindows();
} catch (error: any) {
throw "Failed to get Ghostscript:\n" + error.toString();
}

let gspath = "c:\\program files\\gs\\" +
fs.readdirSync("c:\\program files\\gs") +
"\\bin";
core.addPath(gspath); }
core.addPath(gspath);
}
}

async function acquireFortranMacOS(version: string): Promise<string> {
Expand Down Expand Up @@ -567,17 +561,6 @@ async function acquireRtools(version: IRVersion) {
}
}

async function acquireQpdfWindows() {
await core.group("Downloading and installing qpdf", async() => {
const dlpath = await tc.downloadTool("https://github.com/r-lib/actions/releases/download/sysreqs0/qpdf.nupkg");
await io.mv(dlpath, path.join(tempDirectory, "qpdf.nupkg"));
await exec.exec(
"choco",
["install", "qpdf", "--source", tempDirectory]
);
})
}

async function acquireGsWindows() {
await core.group("Downloading and installing Ghostscript", async() => {
const dlpath = await tc.downloadTool("https://github.com/r-lib/actions/releases/download/sysreqs0/ghostscript-10.03.0-win.zip");
Expand Down

0 comments on commit 7171bbd

Please sign in to comment.