From 0a013aa05a546d5df0e2c3a601a31dd70c8c7622fc7ed7371b21f1390640a813 Mon Sep 17 00:00:00 2001 From: kira Date: Fri, 31 Jul 2026 16:35:30 +0200 Subject: [PATCH] Scripts to sign packages and create repository. --- tools/add_to_repo.sh | 19 +++++++++++++++++++ tools/sign_all.sh | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tools/add_to_repo.sh create mode 100644 tools/sign_all.sh diff --git a/tools/add_to_repo.sh b/tools/add_to_repo.sh new file mode 100644 index 0000000..4802968 --- /dev/null +++ b/tools/add_to_repo.sh @@ -0,0 +1,19 @@ +#!/bin/sh + + +repodir=$1 +reponame=kira-base +pattern="*.pkg.tar.zst" + +# Combine directory and pattern. +# Quote the directory to handle spaces, leave pattern unquoted for expansion. +for pkgfile in "$repodir"/$pattern; do + # CRITICAL: Check if file exists. + # If no files match, 'sh' returns the literal string (e.g., /dir/*.txt) + if [ -e "$pkgfile" ]; then + echo "Signing $pkgfile" + repo-add --verify --sign "$repodir"/"$reponame".db.tar.gz "${pkgfile}" + fi +done + + diff --git a/tools/sign_all.sh b/tools/sign_all.sh new file mode 100644 index 0000000..0dfa344 --- /dev/null +++ b/tools/sign_all.sh @@ -0,0 +1,18 @@ +#!/bin/sh + + +repodir=$1 +pattern="*.pkg.tar.zst" + +# Combine directory and pattern. +# Quote the directory to handle spaces, leave pattern unquoted for expansion. +for pkgfile in "$repodir"/$pattern; do + # CRITICAL: Check if file exists. + # If no files match, 'sh' returns the literal string (e.g., /dir/*.txt) + if [ -e "$pkgfile" ]; then + echo "Signing $pkgfile" + gpg --use-agent --output "${pkgfile}".sig --detach-sig "${pkgfile}" + fi +done + +