chore(publish): Keep the mlucas binaries out of git and the bundle
src/Script_ABC_Blanton/hammer/ is ~99 MB of unstripped mlucas ELF binaries (avx512 / avx2 / avx / sse2 / generic-c). They come with the DUT image, so this repo has no reason to carry them - and a binary tree that size is permanent once committed: every clone pays for it forever. publish.sh excluded them too, because rsync copies whatever happens to be sitting in src/. Without the exclude the delivery bundle was ~100 MB from a machine that had the binaries and ~200 KB from a fresh clone. While there, usage() read a fixed line range of the header, so adding a Version History entry pushed code into the usage text. It now reads up to the first line of code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
This commit is contained in:
@@ -31,3 +31,6 @@ publish/*
|
|||||||
|
|
||||||
# 尚未上機驗證的腳本暫存區(不入 repo,測過再搬進 src/)
|
# 尚未上機驗證的腳本暫存區(不入 repo,測過再搬進 src/)
|
||||||
tmp/
|
tmp/
|
||||||
|
|
||||||
|
# mlucas 的 ELF binary(~99 MB),DUT image 已內含,不入 repo
|
||||||
|
src/Script_ABC_Blanton/hammer/
|
||||||
|
|||||||
+14
-2
@@ -7,6 +7,9 @@
|
|||||||
# publish/Script_ABC_Blanton_<Version>, taking <Version>
|
# publish/Script_ABC_Blanton_<Version>, taking <Version>
|
||||||
# from the "; Version : Vx.y.z" header of
|
# from the "; Version : Vx.y.z" header of
|
||||||
# 1_Blanton_Script_A.ttl.
|
# 1_Blanton_Script_A.ttl.
|
||||||
|
# V1.0.1 2026-09-06 Exclude hammer/ (the mlucas binaries) from the bundle,
|
||||||
|
# so the output no longer depends on whether the developer
|
||||||
|
# has them in their working tree.
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
#
|
#
|
||||||
# The version is READ FROM Script A rather than passed in, so the folder name
|
# The version is READ FROM Script A rather than passed in, so the folder name
|
||||||
@@ -33,7 +36,9 @@ info() { printf '[\033[34mINFO\033[0m] %s\n' "$*"; }
|
|||||||
ok() { printf '[\033[32m OK \033[0m] %s\n' "$*"; }
|
ok() { printf '[\033[32m OK \033[0m] %s\n' "$*"; }
|
||||||
die() { printf '[\033[31mERR \033[0m] %s\n' "$*" >&2; exit 1; }
|
die() { printf '[\033[31mERR \033[0m] %s\n' "$*" >&2; exit 1; }
|
||||||
|
|
||||||
usage() { sed -n '2,26p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'; exit 0; }
|
# Print the header block above, up to (but not including) the first line of
|
||||||
|
# code, so adding a Version History entry never truncates the usage text.
|
||||||
|
usage() { sed -n '2,/^set -u/p' "${BASH_SOURCE[0]}" | sed '$d' | sed 's/^# \{0,1\}//'; exit 0; }
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -86,12 +91,19 @@ fi
|
|||||||
# Captured console logs are per-run and often carry DUT serials, so they are
|
# Captured console logs are per-run and often carry DUT serials, so they are
|
||||||
# never shipped; the empty logs/ directory itself is kept because Script A's
|
# never shipped; the empty logs/ directory itself is kept because Script A's
|
||||||
# logopen writes into it.
|
# logopen writes into it.
|
||||||
|
#
|
||||||
|
# hammer/ is excluded as well: it is ~99 MB of mlucas ELF binaries that the DUT
|
||||||
|
# image already carries, and it is gitignored. Without this exclude the bundle
|
||||||
|
# would depend on whether the developer happened to have the binaries sitting in
|
||||||
|
# src/ - 100 MB from one machine, 200 KB from a fresh clone.
|
||||||
mkdir -p -- "${DEST}" || die "cannot create ${DEST}"
|
mkdir -p -- "${DEST}" || die "cannot create ${DEST}"
|
||||||
if command -v rsync >/dev/null 2>&1; then
|
if command -v rsync >/dev/null 2>&1; then
|
||||||
rsync -a --exclude='*.log' "${SRC_DIR}/" "${DEST}/" || die "rsync failed"
|
rsync -a --exclude='*.log' --exclude='hammer/' "${SRC_DIR}/" "${DEST}/" \
|
||||||
|
|| die "rsync failed"
|
||||||
else
|
else
|
||||||
cp -a -- "${SRC_DIR}/." "${DEST}/" || die "cp failed"
|
cp -a -- "${SRC_DIR}/." "${DEST}/" || die "cp failed"
|
||||||
find "${DEST}" -type f -name '*.log' -delete
|
find "${DEST}" -type f -name '*.log' -delete
|
||||||
|
rm -rf -- "${DEST}/hammer"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tera Term's logopen target, in case the source tree never had one
|
# Tera Term's logopen target, in case the source tree never had one
|
||||||
|
|||||||
Reference in New Issue
Block a user