mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 02:15:06 +03:00
Upload .tar.xz bottles too
This commit is contained in:
parent
ede28cb81e
commit
5fb72446cf
2 changed files with 12 additions and 5 deletions
|
@ -1,6 +1,10 @@
|
|||
#!/usr/bin/env -S tea -E
|
||||
|
||||
/* ---
|
||||
dependencies:
|
||||
gnu.org/tar: ^1.34
|
||||
tukaani.org/xz: ^5
|
||||
zlib.net: 1
|
||||
args:
|
||||
- deno
|
||||
- run
|
||||
|
@ -27,6 +31,8 @@ const cellar = useCellar()
|
|||
if (import.meta.main) {
|
||||
useFlags()
|
||||
|
||||
const compression = Deno.env.get("COMPRESSION") == 'xz' ? 'xz' : 'gz'
|
||||
|
||||
const bottles: Path[] = []
|
||||
const checksums: Path[] = []
|
||||
const artifacts: Path[] = []
|
||||
|
@ -34,7 +40,7 @@ if (import.meta.main) {
|
|||
console.log({ bottling: { pkg } })
|
||||
|
||||
const installation = await cellar.resolve(pkg)
|
||||
const path = await bottle(installation)
|
||||
const path = await bottle(installation, compression)
|
||||
const checksum = await sha256(path)
|
||||
|
||||
console.log({ bottled: { path } })
|
||||
|
@ -60,10 +66,11 @@ if (import.meta.main) {
|
|||
|
||||
|
||||
//------------------------------------------------------------------------- funcs
|
||||
export async function bottle({ path: kegdir, pkg }: Installation): Promise<Path> {
|
||||
const tarball = useCache().bottle(pkg)
|
||||
export async function bottle({ path: kegdir, pkg }: Installation, compression: 'gz' | 'xz'): Promise<Path> {
|
||||
const tarball = useCache().bottle(pkg, compression)
|
||||
const z = compression == 'gz' ? 'z' : 'J'
|
||||
const cwd = usePrefix()
|
||||
const cmd = ["tar", "zcf", tarball, kegdir.relative({ to: cwd })]
|
||||
const cmd = ["tar", `c${z}f`, tarball, kegdir.relative({ to: cwd })]
|
||||
await run({ cmd, cwd })
|
||||
return tarball
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ args:
|
|||
- --import-map={{ srcroot }}/import-map.json
|
||||
---*/
|
||||
|
||||
import { Installation, Package, PackageRequirement } from "types"
|
||||
import { Package, PackageRequirement } from "types"
|
||||
import { usePantry, useCellar, useFlags } from "hooks"
|
||||
import useShellEnv, { expand } from "hooks/useShellEnv.ts"
|
||||
import { run, undent, pkg as pkgutils } from "utils"
|
||||
|
|
Loading…
Reference in a new issue