From ebb26eac2948e02def3c7ac1ac23c4ecd345a5a7 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 3 Apr 2026 18:17:29 +0200 Subject: repo: flatten layout — move packages to root, extras to .extras/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move all packages from SlackBuilds/ to repo root - Move hooks/, docs/, nvchecker.toml to .extras/ - Update CLAUDE.md and README.md to reflect new structure Co-Authored-By: Claude Sonnet 4.6 --- .extras/hooks/post-commit | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 .extras/hooks/post-commit (limited to '.extras/hooks/post-commit') diff --git a/.extras/hooks/post-commit b/.extras/hooks/post-commit new file mode 100755 index 0000000..c9241ae --- /dev/null +++ b/.extras/hooks/post-commit @@ -0,0 +1,51 @@ +#!/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: \t +# 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") + # Only process packages at SlackBuilds/ depth + [[ "$dir" =~ ^SlackBuilds/[^/]+$ ]] || continue + [[ "$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 "" + printf "Create SBo archive for '%s'? [y/N] " "$pkg" + read -r answer Archive created: SBo/$pkg.tar.gz" + else + echo " -> Archive FAILED." >&2 + fi + ;; + *) + echo " -> Skipped." + ;; + esac +done + +exit 0 -- cgit v1.2.3