#!/bin/sh # bump-build.sh - Increment the MontaukOS kernel build number. # # Reads the current MONTAUK_BUILD_NUMBER from the given header, increments it, # and rewrites the header in place. Invoked by kernel/GNUmakefile whenever the # kernel or userspace sources change, so the build number reflects real builds. # # Usage: ./scripts/bump-build.sh set -e HDR="$1" if [ -z "$HDR" ] || [ ! -f "$HDR" ]; then echo "bump-build.sh: header not found: $HDR" >&2 exit 1 fi cur=$(sed -n 's/^#define MONTAUK_BUILD_NUMBER \([0-9][0-9]*\).*/\1/p' "$HDR") if [ -z "$cur" ]; then echo "bump-build.sh: could not parse MONTAUK_BUILD_NUMBER in $HDR" >&2 exit 1 fi next=$((cur + 1)) cat > "$HDR" < $next"