Harden automation: apply only build patches, default clean, install binaries

This commit is contained in:
2025-12-14 17:03:40 +01:00
parent c30f6ceaea
commit e352e92c3c
3 changed files with 40 additions and 20 deletions

View File

@@ -7,7 +7,7 @@ PATCHDIR="${ROOT}/patches"
usage() {
cat <<USAGE
Usage: $0
Applies patches/*.patch to the working tree (idempotent).
Applies patches 00010004 to the working tree (idempotent).
USAGE
}
@@ -23,18 +23,16 @@ if [[ ! -d "$PATCHDIR" ]]; then
exit 1
fi
# Apply patches only if they are not already applied.
# We use --dry-run to test applicability; if it fails, we assume it's already applied.
shopt -s nullglob
patches=( "$PATCHDIR"/000[1-4]-*.patch )
#patches=( "$PATCHDIR"/*.patch )
if (( ${#patches[@]} == 0 )); then
echo "ERROR: no patches found in $PATCHDIR" >&2
echo "ERROR: no 00010004 patches found in $PATCHDIR" >&2
exit 1
fi
for p in "${patches[@]}"; do
echo "==> Checking $p"
echo "==> Checking $(basename "$p")"
if patch --dry-run -p1 < "$p" >/dev/null 2>&1; then
echo "==> Applying $(basename "$p")"
patch -p1 < "$p"