mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-22 22:20:52 +00:00
Add option to list the generated files and exit
This is useful during the release process, when we want to commit the generated files. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
494678a405
commit
1fe01acfc3
@ -23,12 +23,13 @@ set -eu
|
||||
|
||||
if [ $# -ne 0 ] && [ "$1" = "--help" ]; then
|
||||
cat <<EOF
|
||||
$0 [-u]
|
||||
$0 [-l | -u]
|
||||
This script checks that all generated file are up-to-date. If some aren't, by
|
||||
default the scripts reports it and exits in error; with the -u option, it just
|
||||
updates them instead.
|
||||
|
||||
-u Update the files rather than return an error for out-of-date files.
|
||||
-l List generated files, but do not update them.
|
||||
EOF
|
||||
exit
|
||||
fi
|
||||
@ -39,10 +40,13 @@ if [ -d library -a -d include -a -d tests ]; then :; else
|
||||
fi
|
||||
|
||||
UPDATE=
|
||||
if [ $# -ne 0 ] && [ "$1" = "-u" ]; then
|
||||
shift
|
||||
UPDATE='y'
|
||||
fi
|
||||
LIST=
|
||||
while getopts lu OPTLET; do
|
||||
case $OPTLET in
|
||||
l) LIST=1;;
|
||||
u) UPDATE=1;;
|
||||
esac
|
||||
done
|
||||
|
||||
# check SCRIPT FILENAME[...]
|
||||
# check SCRIPT DIRECTORY
|
||||
@ -58,6 +62,11 @@ check()
|
||||
SCRIPT=$1
|
||||
shift
|
||||
|
||||
if [ -n "$LIST" ]; then
|
||||
printf '%s\n' "$@"
|
||||
return
|
||||
fi
|
||||
|
||||
directory=
|
||||
if [ -d "$1" ]; then
|
||||
directory="$1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user