cleanup scripts: tools/

This commit is contained in:
CvH
2024-07-06 11:24:18 +02:00
parent 52d0bad764
commit 7f543e3c98
25 changed files with 350 additions and 338 deletions

View File

@@ -25,19 +25,17 @@ BUILD_SOURCES="false"
REPLACE_OLD="false"
NEW_SOURCES="${NEW_SOURCES_DIR:-${SOURCES}.new}"
# helper functions
help(){
help() {
echo "Usage: ${0} [-hdfbr]"
echo "Set PROJECT, DEVICE and ARCH as required."
echo " -h this help"
echo " -d delete obsolete source packages (default no)"
echo " -f fetch updated source packages (default: no)"
echo " -b build new SOURCES content (default: no)"
echo " -r replace old SOURCES when rebuilding (default: no)"
echo "Set PROJECT, DEVICE and ARCH as required."
echo " -h this help"
echo " -d delete obsolete source packages (default no)"
echo " -f fetch updated source packages (default: no)"
echo " -b build new SOURCES content (default: no)"
echo " -r replace old SOURCES when rebuilding (default: no)"
}
# command line opts
while getopts hdfrb OPT; do
case "${OPT}" in
@@ -65,8 +63,7 @@ while getopts hdfrb OPT; do
esac
done
shift $((${OPTIND}-1))
shift $((${OPTIND} - 1))
# sanity checking
if [ ! -d "${SOURCES}" ]; then
@@ -75,7 +72,6 @@ elif [ "${DESTRUCTIVE_RUN}" = "true" -a "${BUILD_SOURCES}" = "true" ]; then
die "error: options '-d' and '-b' are mutually exclusive"
fi
# main
# process files in SOURCES
for SOURCE_PACKAGE in $(find "${SOURCES}/" -mindepth 1 -type d); do