From 7de7d53b70e5d08d16b002cf823ccb34346d0908 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 11 Feb 2026 11:15:27 -0500 Subject: [PATCH] scripts: Add help screen to meld-all and display if file is 'not upstream' Add a help screen to meld-all and display if a file is not found in the upstream repo. Signed-off-by: Stefan Berger --- scripts/meld-all | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/scripts/meld-all b/scripts/meld-all index 3aae682b..716ca50b 100755 --- a/scripts/meld-all +++ b/scripts/meld-all @@ -5,6 +5,27 @@ SKIP_FILES="(Marshal.c|Marshal_fp.h)" NO_MELD_FLAG=$((1<<0)) +help() +{ + cat <<_EOF_ +Usage: TCG_TPM_HOME=... $1 [options] TPM2-directory + +The following options are available: + +--no-meld,--diff-only : Only display diffs between files; the first two lines + are related to the license and are ignore for the diff. +--help : Display this help screen and exit. + +The environmet variable TCG_TPM_HOME must be set and point to +the TCG TPM2 git checkout. + +Example: + +TCG_TPM_HOME=\$HOME/TPM $1 --diff-only src/tpm2 + +_EOF_ +} + main() { local opts f fname upstream flags @@ -74,14 +95,18 @@ main() if [ $((flags & NO_MELD_FLAG)) -eq 0 ]; then meld "${upstrean}" "${f}" else - echo "Something wrong with file $f" + echo "Something is wrong with file $f" fi fi line=$((line+1)) if [ $((flags & NO_MELD_FLAG)) -ne 0 ]; then echo "============================================================================" - echo "${f}" - diff --ignore-trailing-space <(sed -n "${line},\$p" < "${f}") "${upstream}" + if [ ! -f "${upstream}" ]; then + echo "${f}: file does not exist upstream" + else + echo "${f}" + diff --ignore-trailing-space <(sed -n "${line},\$p" < "${f}") "${upstream}" + fi fi if ! diff --ignore-trailing-space <(sed -n "${line},\$p" < "${f}") "${upstream}" &>/dev/null; then if [ $((flags & NO_MELD_FLAG)) -eq 0 ]; then