Skip to content

Support .deb packages #25

Description

@andrew

A .deb is an ar archive with three members in order: debian-binary (the text 2.0\n), control.tar.{gz,xz,zst} with package metadata, and data.tar.{gz,xz,zst} with the installed file tree. Current Debian and Ubuntu default to zstd for both tarballs.

There is no ar reader in the Go stdlib. The format is 8 bytes of global magic (!<arch>\n) followed by 60-byte fixed-width ASCII headers per member, so hand-rolling it is about 50 lines and avoids a dependency; blakesmith/ar is the usual third-party option if we would rather import one. Member names longer than 16 bytes use the GNU / + string-table convention but the three deb member names are all short so that can be skipped initially.

Present it like gems: unwrap data.tar.* as the root file tree and expose control.tar.* under a DEBIAN/ prefix so callers can read DEBIAN/control for metadata, matching the dpkg-deb -R layout.

Blocked on #23 for the zstd inner tarballs; gzip and xz members already work once ar parsing exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions