Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/cmd/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S pkgx +rsync +git +bash +gum +gh +curl +bzip2 +xz +unzip deno run --ext=ts --allow-env --allow-read --allow-write --allow-run --allow-net
#!/usr/bin/env -S pkgx +rsync +git +bash +gum +gh +curl +bzip2 +xz +unzip +lzip deno run --ext=ts --allow-env --allow-read --allow-write --allow-run --allow-net
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are become epic


import make_build_script from "brewkit/porcelain/build-script.ts"
import { gum, rsync } from "brewkit/utils.ts"
Expand Down
43 changes: 5 additions & 38 deletions lib/utils/Unarchiver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageRequirement, Path, semver } from "pkgx"
import { Path } from "pkgx"

interface Options {
dstdir: Path
Expand All @@ -19,14 +19,8 @@ export class Unarchiver {
supports(_filename: Path): boolean {
return false
}

dependencies(): PackageRequirement[] {
return []
}
}

const constraint = new semver.Range("*")

export class TarballUnarchiver extends Unarchiver {
private stripComponents?: number

Expand All @@ -49,36 +43,16 @@ export class TarballUnarchiver extends Unarchiver {
case ".tar.gz":
case ".tar.bz2":
case ".tar.xz":
case ".tar.lz":
case ".tgz":
case ".tbz2":
case ".txz":
case ".tlz":
return true
default:
return false
}
}

dependencies() {
const rv = [{
project: "gnu.org/tar",
constraint
}]
switch (this.opts.zipfile.extname()) {
case ".tbz":
case ".tar.bz2":
rv.push({
project: "sourceware.org/bzip2",
constraint
})
break
case ".txz":
case ".tar.xz":
rv.push({
project: "tukaani.org/xz",
constraint
})
break
}
return rv
}
}

export class ZipUnarchiver extends Unarchiver {
Expand All @@ -104,11 +78,4 @@ export class ZipUnarchiver extends Unarchiver {
static supports(filename: Path): boolean {
return filename.extname() == ".zip"
}

dependencies() {
return [{
project: "info-zip.org/unzip",
constraint
}]
}
}