From fc9473c9bdc749d9a8c9c048736499257f92dc08 Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Mon, 11 Dec 2023 23:34:44 +0000 Subject: [PATCH] fix: one more unarchive dedgecase --- ghjk.ts | 4 ++-- ports/ruff.ts | 12 ++++++++++-- utils/unarchive.ts | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ghjk.ts b/ghjk.ts index fcfd41e0..77657aea 100644 --- a/ghjk.ts +++ b/ghjk.ts @@ -30,6 +30,6 @@ import whiz from "./ports/whiz.ts"; // installType: "version", // }); // protoc({}); -earthly({}); -// ruff({}); +// earthly({}); +ruff({}); // whiz({}); diff --git a/ports/ruff.ts b/ports/ruff.ts index 27a398f2..519a92f2 100644 --- a/ports/ruff.ts +++ b/ports/ruff.ts @@ -1,6 +1,7 @@ import { $, addInstallGlobal, + depBinShimPath, DownloadArgs, downloadFile, GithubReleasePort, @@ -11,14 +12,18 @@ import { std_fs, std_path, std_url, - unarchive, } from "../port.ts"; +import * as std_ports from "../modules/ports/std.ts"; const manifest = { ty: "denoWorker" as const, name: "ruff@ghrel", version: "0.1.0", moduleSpecifier: import.meta.url, + deps: [ + // we have to use tar because their tarballs for darwin use gnu sparse + std_ports.tar_aa, + ], }; registerDenoPortGlobal(manifest, () => new Port()); @@ -47,8 +52,11 @@ export class Port extends GithubReleasePort { const fileName = std_url.basename( artifactUrl(args.installVersion, args.platform), ); + const fileDwnPath = std_path.resolve(args.downloadPath, fileName); - await unarchive(fileDwnPath, args.tmpDirPath); + await $`${ + depBinShimPath(std_ports.tar_aa, "tar", args.depShims) + } xf ${fileDwnPath} --directory=${args.tmpDirPath}`; const installPath = $.path(args.installPath); if (await installPath.exists()) { diff --git a/utils/unarchive.ts b/utils/unarchive.ts index 39bf096e..f4c57492 100644 --- a/utils/unarchive.ts +++ b/utils/unarchive.ts @@ -10,6 +10,7 @@ import { /// Uses file extension to determine type /// Does not support extracting symlinks +/// Does not support tarballs using [GnuSparse](https://www.gnu.org/software/tar/manual/html_node/Sparse-Recovery.html) export async function unarchive( path: string, dest = "./",