aboutsummaryrefslogtreecommitdiffstats
path: root/.extras
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-25 10:37:06 +0200
committerDanilo M. <danix@danix.xyz>2026-09-25 10:37:06 +0200
commit20410eb37442a510e9ca3f1b038cee647ae5bf21 (patch)
tree26819129dcdc1614e7861122a2d1ba9c38783d44 /.extras
parent9e4f0fa4c4273a81f40f26177604c43856dff8c1 (diff)
downloadslackware-pentesting-suite-20410eb37442a510e9ca3f1b038cee647ae5bf21.tar.gz
slackware-pentesting-suite-20410eb37442a510e9ca3f1b038cee647ae5bf21.zip
Move maintainer tooling out of the repo
Git hooks, the upstream sweep and the SBo delivery workflow are the maintainer's operational tools, not package knowledge. They now live in a private workspace that wraps all three SlackBuild repos, with one shared copy of each hook instead of three drifting ones. Also in this pass: - AGENTS.md: checksum loop documented as sbodl (sbofixinfo does not fix checksums), nvchecker must not run without a token config, prefer use_latest_release over use_max_tag - README: Git Hooks section replaced by a short Contributing note - sweep report renamed to LAST_SWEEP.md across all three repos Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to '.extras')
-rwxr-xr-x.extras/hooks/post-commit66
-rwxr-xr-x.extras/hooks/pre-commit84
-rwxr-xr-x.extras/mksboarchive45
3 files changed, 0 insertions, 195 deletions
diff --git a/.extras/hooks/post-commit b/.extras/hooks/post-commit
deleted file mode 100755
index 6ed63f7..0000000
--- a/.extras/hooks/post-commit
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-# post-commit hook: create SBo submission archive for added/updated packages
-set -u
-
-REPO_ROOT=$(git rev-parse --show-toplevel)
-SBO_DIR="$REPO_ROOT/SBo"
-
-# Find packages whose .SlackBuild was added (A) or modified (M) in this commit.
-# git diff-tree output format: <status>\t<file>
-# We only want files exactly one directory deep, e.g. hugo/hugo.SlackBuild.
-PACKAGES=()
-while IFS=$'\t' read -r status file; do
- [[ "$status" != "A" && "$status" != "M" ]] && continue
- dir=$(dirname "$file")
- base=$(basename "$file")
- [[ "$dir" == "." ]] && continue # skip root-level files
- [[ "$dir" == *"/"* ]] && continue # skip files deeper than one level
- [[ "$base" == *.SlackBuild ]] || continue
- PACKAGES+=("$dir")
-done < <(git diff-tree --no-commit-id -r --name-status HEAD)
-
-[[ ${#PACKAGES[@]} -eq 0 ]] && exit 0
-
-for pkg in "${PACKAGES[@]}"; do
- echo ""
- echo "==> Package: $pkg"
- echo ""
- echo "Files to be archived:"
- echo "---------------------"
- while IFS= read -r f; do
- printf '%s\n' "${f#"$REPO_ROOT/"}"
- done < <(find "$REPO_ROOT/$pkg" -type f | sort)
- echo ""
- # Non-interactive override: set SBO_ARCHIVE=yes|no to skip the prompt.
- # Lets agents and scripts answer without a terminal.
- case "${SBO_ARCHIVE:-}" in
- [yY]|[yY][eE][sS]) answer=yes ;;
- [nN]|[nN][oO]) echo " -> Skipped (SBO_ARCHIVE=no)."; continue ;;
- "")
- # No override: need an interactive terminal to prompt.
- if [ ! -r /dev/tty ]; then
- echo " -> No terminal, skipped (set SBO_ARCHIVE=yes to archive)."
- continue
- fi
- printf "Create SBo archive for '%s'? [y/N] " "$pkg"
- answer=""
- read -r answer </dev/tty || answer=""
- ;;
- *) echo " -> Skipped (SBO_ARCHIVE='$SBO_ARCHIVE' unrecognized)."; continue ;;
- esac
- case "$answer" in
- [yY]|[yY][eE][sS])
- mkdir -p "$SBO_DIR"
- if tar -czf "$SBO_DIR/$pkg.tar.gz" -C "$REPO_ROOT" "$pkg"; then
- echo " -> Archive created: SBo/$pkg.tar.gz"
- else
- echo " -> Archive FAILED." >&2
- fi
- ;;
- *)
- echo " -> Skipped."
- ;;
- esac
-done
-
-exit 0
diff --git a/.extras/hooks/pre-commit b/.extras/hooks/pre-commit
deleted file mode 100755
index d2f9506..0000000
--- a/.extras/hooks/pre-commit
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/bash
-
-# 20220315 bkw: SBo pre-commit hook, wrapper for sbolint.
-
-# Installation:
-
-# Copy this to <gitdir>/.git/hooks, mode 0755 (or anyway, make it
-# executable). Also get sbolint and install it somewhere on $PATH,
-# like /usr/local/bin. sbolint comes from:
-
-# https://slackware.uk/~urchlay/repos/sbostuff/plain/sbolint
-
-# That's a wgettable URL. You can also clone the sbostuff
-# repo from https://slackware.uk/~urchlay/repos/sbostuff if you want.
-
-# Usage:
-
-# Just do your usual "git commit". When you do, sbolint will run on
-# the build you're updating. If it finds any issues, it will cause the
-# commit to abort, so you can fix whatever's wrong and try the commit
-# again.
-
-# Since sbolint isn't perfect, you can skip the check for any commit
-# by running e.g:
-
-# SBOLINT=no git commit <arguments>
-
-# You can also run sbolint by itself, and read its documentation with
-# "sbolint --docs".
-
-set -e
-exec 1>&2
-
-# Check for staged source archives (.tar.gz, .tar.xz, .tar.bz2, .zip, etc.)
-# Symlinks: auto-removed. Regular files: blocked (must not be committed).
-source_pattern='\.\(tar\.gz\|tar\.xz\|tar\.bz2\|tar\.zst\|tgz\|zip\|7z\|rpm\|deb\)$'
-source_blocked=""
-while IFS= read -r f; do
- mode=$(git ls-files --stage -- "$f" | awk '{print $1}')
- if [ "$mode" = "120000" ]; then
- echo "Removing staged symlink to source archive: $f"
- git rm --cached -q -- "$f"
- rm -f "$f"
- else
- source_blocked="$source_blocked $f"
- fi
-done < <(git diff --cached --name-only | grep -i "$source_pattern")
-if [ -n "$source_blocked" ]; then
- echo "*** ERROR: source archives staged for commit:"
- for f in $source_blocked; do echo "*** $f"; done
- echo "*** Remove them with: git rm --cached -- $source_blocked"
- exit 1
-fi
-
-# There should normally only be one changed build per commit, but this
-# rule may get broken when the repo's frozen pending a new Slackware
-# release. So use a loop.
-
-# The weird-looking "< <(command)" syntax is why this script must
-# have a #!/bin/bash at the top: it won't work with #!/bin/sh, even if
-# /bin/sh is a symlink to bash.
-
-if [ "${SBOLINT:-yes}" = "yes" ]; then
- sbolintfailed=""
- if ! which sbolint &>/dev/null; then
- echo "WARNING: can't find sbolint in PATH, no linting will be done"
- else
- while read build; do
- # if there's no slack-desc or README, assume the build has been removed.
- # the directory still might exist after a "git rm -rf" because it
- # might contain untracked files (e.g. the source tarball).
- if [ -e "$build/slack-desc" -o -e "$build/README" ]; then
- sbolint "$build" || sbolintfailed=1
- fi
- done < <(git diff --cached --name-only | cut -d/ -f1,2 | sort -u)
- fi
- if [ -n "$sbolintfailed" ]; then
- echo "*** sbolint failed, fix the errors or set SBOLINT=no"
- echo "*** in the environment to commit anyway."
- exit 1
- fi
-fi
-
-exit 0
diff --git a/.extras/mksboarchive b/.extras/mksboarchive
deleted file mode 100755
index 8691f48..0000000
--- a/.extras/mksboarchive
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/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() {
- cat <<EOF
-usage: ${0##*/} <package-name>
-
-Build the SBo submission tarball <package-name>.tar.gz, the same archive the
-post-commit hook produces, on demand by name. Run from the repo root: the
-package is the <package-name>/ directory below the current directory, with a
-matching <package-name>.SlackBuild. Any sbodl source symlinks in the package
-directory are removed first so they never leak into the tarball.
-
-Output goes to SBo/ by default; set OUTPUT to override:
- OUTPUT=/tmp ${0##*/} feroxbuster # writes /tmp/feroxbuster.tar.gz
-EOF
-}
-
-case "${1:-}" in
- -h|--help) usage; exit 0 ;;
-esac
-[ $# -eq 1 ] || { usage >&2; exit 2; }
-
-pkg=$1
-
-# Run this from the repo root. The package is the <pkg>/ directory below the
-# current directory; the tarball is written to SBo/ by default, override with
-# the OUTPUT env var.
-OUTPUT=${OUTPUT:-$PWD/SBo}
-
-# Must be a real package dir below CWD with a matching .SlackBuild.
-if [ ! -f "$pkg/$pkg.SlackBuild" ]; then
- echo "error: no '$pkg/$pkg.SlackBuild' here. Run from the repo root." >&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 "$pkg" -type l -delete
-
-mkdir -p "$OUTPUT"
-tar -czf "$OUTPUT/$pkg.tar.gz" "$pkg"
-echo "Archive created: $OUTPUT/$pkg.tar.gz"