From e36285e238ab2216b93b83a33d9d74c95c017ce0 Mon Sep 17 00:00:00 2001 From: memdmp Date: Sat, 14 Jun 2025 06:10:21 +0200 Subject: feat: some scripting --- build-repo | 4 +--- cleanbuild-repo | 17 +++++++++++++++++ pkg | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 cleanbuild-repo diff --git a/build-repo b/build-repo index 8dc08a7..eb0b492 100755 --- a/build-repo +++ b/build-repo @@ -2,8 +2,6 @@ set -eax # note: we assume `abuild-keygen -a -i` has alr been run ALL_TARGET="$PWD/target" -if [[ "$RM_TARGET" != "" ]]; then rm -rf "$ALL_TARGET"; fi -mkdir -p "$ALL_TARGET" export APORTSDIR="$PWD/src" for REPOPATH in ./src/*; do cd "$REPOPATH"; @@ -13,7 +11,7 @@ for REPOPATH in ./src/*; do cd "$PKG"; PKG="$(basename "$PKG")"; - if [[ "$FILTER" == "" ]] || [[ "$FILTER" == "$REPO" ]] || [[ "$FILTER" == "$PKG" ]]; then + if [[ "$FILTER" == "" ]] || [[ "$FILTER" == "$REPO" ]] || [[ "$FILTER" == "$PKG" ]] || [[ "$FILTER" == "$REPO/$PKG" ]]; then if [[ "$NEWSUM" == "1" ]]; then abuild checksum; fi if [[ "$ROOTBLD" != "0" ]]; then abuild -P "$ALL_TARGET" rootbld diff --git a/cleanbuild-repo b/cleanbuild-repo new file mode 100755 index 0000000..3bb274f --- /dev/null +++ b/cleanbuild-repo @@ -0,0 +1,17 @@ +#!/usr/bin/env zsh +set -e +# This script exists to be able to build repositories, from scratch, without having any existing packages prebuild in the target directory. +# It only works with rootbld. +ALL_TARGET="$PWD/target" +rm -rf "$ALL_TARGET" +mkdir "$ALL_TARGET" +source env +buildpkg() { + (cd src/"$1" && abuild -P "$ALL_TARGET" rootbld) +} + +# pkgs with dependents +buildpkg util/gcompat-libdl2 + +# build the rest +"$PWD/build-repo" diff --git a/pkg b/pkg index a09fee4..b8ca3ba 100755 --- a/pkg +++ b/pkg @@ -24,4 +24,4 @@ elif [[ "$OPERATION" == "add" ]]; then sudo apk add --repository "$(busybox dirname "$(busybox realpath "$BIN")")/target/$REPO" "$PKG"; else syntax; -fi \ No newline at end of file +fi -- cgit v1.2.3