Skip to content

itchio/boar

Repository files navigation

boar

build Go Report Card GoDoc MIT licensed

boar will sniff any archive, and maybe even let you extract it.

Format Support

Format Extractor Native Dependency
.zip zipextractor (via savior) None (pure Go)
.tar tarextractor (via savior) None (pure Go)
.tar.gz tarextractor + gzipsource None (pure Go)
.tar.bz2 tarextractor + bzip2source None (pure Go)
.tar.xz tarextractor + xzsource Requires 7-zip libs
.rar rarextractor (via dmcunrar-go) dmc_unrar (C library)
.7z szextractor (via sevenzip-go) 7z.so + libc7zip.so
.exe (self-extracting) szextractor 7z.so + libc7zip.so

Formats with native dependencies will fail to extract if the required libraries are not available. The pure Go extractors work without any additional dependencies.

Native library installation

The szextractor package can automatically download the required 7-zip native libraries at runtime from broth.itch.zone/libc7zip, itch.io's binary distribution service. When szextractor.EnsureDeps is called, it checks for the required libraries next to the executable and fetches them from broth if they are missing or have mismatched hashes.

By default, library versions and hashes are pinned in the hardcoded formulas under szextractor/formulas/. You can override this to fetch from a specific broth channel (e.g. head for the latest build) using szextractor.SetDepChannel("head"), which skips hash verification and fetches from broth.itch.zone/libc7zip/{os}-{arch}-{channel}/LATEST/archive.zip. The szextractor.InstallDeps function can be used to force a fresh download regardless of what is already on disk.

Set the environment variable BUTLER_NO_DEPS=1 to disable automatic dependency fetching entirely.

Dependencies

License

boar's code itself is under MIT License, see LICENSE for details.

However:

About

🐗 boar will sniff and dismantle most archives you throw at it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors