Initial project source
这个提交包含在:
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
|
||||
readonly MANIFEST="${PROJECT_ROOT}/evidence/M0/M0-001/frozen-inputs.sha256"
|
||||
|
||||
fail() {
|
||||
echo "Frozen-input verification failed: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ -f "${MANIFEST}" ]] || fail "checksum manifest is missing"
|
||||
[[ "$(wc -l < "${MANIFEST}" | tr -d ' ')" == "4" ]] || fail "manifest must contain exactly four inputs"
|
||||
|
||||
while read -r checksum relative_path; do
|
||||
[[ "${checksum}" =~ ^[0-9a-f]{64}$ ]] || fail "invalid SHA-256 entry"
|
||||
[[ "${relative_path}" == start-docs/* ]] || fail "input is outside start-docs"
|
||||
[[ "${relative_path}" != start-docs/数据治理平台需求规格说明书_v1.0/* ]] || fail "derived specification is not a frozen original input"
|
||||
[[ -f "${PROJECT_ROOT}/${relative_path}" ]] || fail "frozen input is missing"
|
||||
done < "${MANIFEST}"
|
||||
|
||||
(cd "${PROJECT_ROOT}" && shasum -a 256 -c "${MANIFEST}")
|
||||
|
||||
expected_license="$(sed -n 's/^upstream\.license\.sha256=//p' "${PROJECT_ROOT}/upstream.lock")"
|
||||
[[ "${expected_license}" =~ ^[0-9a-f]{64}$ ]] || fail "upstream license lock is missing"
|
||||
actual_license="$(shasum -a 256 "${PROJECT_ROOT}/LICENSE" | awk '{print $1}')"
|
||||
[[ "${actual_license}" == "${expected_license}" ]] || fail "upstream MIT LICENSE hash drifted"
|
||||
|
||||
upstream_release="$(sed -n 's/^upstream\.release=//p' "${PROJECT_ROOT}/upstream.lock")"
|
||||
upstream_commit="$(sed -n 's/^upstream\.commit=//p' "${PROJECT_ROOT}/upstream.lock")"
|
||||
[[ "${upstream_release}" == "v6.0.0" ]] || fail "upstream release lock drifted"
|
||||
[[ "${upstream_commit}" =~ ^[0-9a-f]{40}$ ]] || fail "upstream commit lock is missing"
|
||||
|
||||
echo "Frozen-input verification passed: four original inputs, upstream MIT LICENSE, and source lock are unchanged."
|
||||
在新工单中引用
屏蔽一个用户