diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-26 11:01:38 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-26 11:01:38 +0200 |
| commit | db2a3c35631f1c90688be0660119c462faf0e851 (patch) | |
| tree | c37b7f852fb4a13e03150aa7b45598867f18e10e | |
| parent | cea7553eff80f20f16bdab32ccd974d21b76aca8 (diff) | |
| download | slackware-pentesting-suite-db2a3c35631f1c90688be0660119c462faf0e851.tar.gz slackware-pentesting-suite-db2a3c35631f1c90688be0660119c462faf0e851.zip | |
extras: add mksboarchive helper to build SBo tarballs on demand
mksboarchive <package> builds the same <package>.tar.gz the post-commit hook
produces, but on demand by name. It validates the package, strips any sbodl
source symlinks, and archives to $OUTPUT (default: CWD). Documented in the
root README.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| -rwxr-xr-x | .extras/mksboarchive | 28 | ||||
| -rw-r--r-- | README.md | 17 |
2 files changed, 45 insertions, 0 deletions
diff --git a/.extras/mksboarchive b/.extras/mksboarchive new file mode 100755 index 0000000..17342d8 --- /dev/null +++ b/.extras/mksboarchive @@ -0,0 +1,28 @@ +#!/bin/bash +# Build the SBo submission tarball SBo/<pkg>.tar.gz for one package. +# Same archive the post-commit hook produces, but on demand by name. +set -eu + +usage() { echo "usage: ${0##*/} <package-name>" >&2; exit 2; } +[ $# -eq 1 ] || usage + +pkg=$1 +REPO_ROOT=$(git -C "$(dirname "$0")" rev-parse --show-toplevel) + +# Where the tarball lands. Defaults to the current directory; override with +# the OUTPUT env var (e.g. OUTPUT=/tmp mksboarchive feroxbuster). +OUTPUT=${OUTPUT:-$PWD} + +# Must be a real package dir one level deep with a matching .SlackBuild. +if [ ! -f "$REPO_ROOT/$pkg/$pkg.SlackBuild" ]; then + echo "error: '$pkg' is not a package in this repo." >&2 + exit 1 +fi + +# Drop any sbodl source symlinks before archiving so they never end up in an +# SBo submission tarball (the pre-commit hook does the same for staged files). +find "$REPO_ROOT/$pkg" -type l -delete + +mkdir -p "$OUTPUT" +tar -czf "$OUTPUT/$pkg.tar.gz" -C "$REPO_ROOT" "$pkg" +echo "Archive created: $OUTPUT/$pkg.tar.gz" @@ -62,6 +62,23 @@ cp .extras/hooks/* .git/hooks/ && chmod 0755 .git/hooks/{pre,post}-commit prompt non-interactively, set `SBO_ARCHIVE=yes` or `SBO_ARCHIVE=no` in the environment. +## Building an SBo archive on demand + +`.extras/mksboarchive <package>` builds the same `<package>.tar.gz` SBo +submission tarball the post-commit hook produces, but on demand by name +rather than at commit time: + +```bash +.extras/mksboarchive feroxbuster # writes ./feroxbuster.tar.gz +OUTPUT=/tmp .extras/mksboarchive hydra # writes /tmp/hydra.tar.gz +``` + +It validates that `<package>/<package>.SlackBuild` exists, removes any +`sbodl` source symlinks from the package directory first (so they never leak +into the tarball), then archives the directory. The output directory defaults +to the current working directory and can be overridden with the `OUTPUT` +environment variable. Run it from anywhere; it locates the repo root via git. + ## Vendored Crates (Rust packages) Rust packages such as `feroxbuster` build from a vendored crates tarball |
