commit 2273c68b845d0937d3f56e15b4e96a087ad95a8b parent 2a1e2046a009bb267bfb135df3acbe2c9f254461 Author: Jan Pobrislo <ccx@te2000.cz> Date: Mon, 12 May 2025 17:13:13 +0000 Add build-commit script Diffstat:
M | commitlist.sha1 | | | 1 | - |
A | util/build-commit | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/commitlist.sha1 b/commitlist.sha1 @@ -353,7 +353,6 @@ fae441e25a1ac266742ba6446b37ae56c8e57076 sources/ccx-utils c6aef8098d37a1773439117a5674bfc8662ef62b sources/confz 3955e658562cef8e6012c1936a6c79c6b6628773 sources/containers 41d6ee2d6aa33b323eee611013dd4aab6a09fc89 sources/containers -c33438f227efa4e8541c3152b684e3925c944f71 sources/containers e8dfe8dcb4396ac0f12f0d0017f9836fa113e3a6 sources/containers 94422be00da71ff44c8ad1fe3455587c62ca29d3 sources/easyseccomp 02de9565862052afc290b6848b4ebd799d8f9f37 sources/execline diff --git a/util/build-commit b/util/build-commit @@ -0,0 +1,45 @@ +#!/bin/sh -xe +cd "$(dirname "$0")/.." + +usage() { + printf '%s\n' 'usage: build-commit <git-commit-hash>' +} + +fatal_usage() { + printf '%s\n' >&2 "fatal: build-commit: $*" + usage + exit 100 +} + +fatal_e111() { + printf '%s\n' >&2 "fatal: $*" + exit 111 +} + +case $#-$1 in + (1-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]*) + ;; + (1-*) + fatal_usage "invalid format of git commit hash" + ;; + (*) + fatal_usage "invalid number of arguments: $#" + ;; +esac + +git fetch --all +git submodule foreach git fetch --all + +# check we got known commit +git show --stat=80 $1 + +# erase local changes +git restore . + +git checkout $1 +git submodule --update --init +if git submodule status --cached | grep '^[ ]'; then + fatal_e111 "failed to get defined submodule states" +fi + +exec make -rs "$@"