From 3f94a8f5e6b1655b1d43a8cf46c84320154bbf1b Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Fri, 3 Oct 2025 09:18:24 -0500 Subject: [PATCH] tidy up install-dependencies script a bit to be more obvious/verbose about usage PROJECT should be community or nova, not enterprise Print out usage message when BUILD_TYPE is not provided or one of the supported values. Added note about where the revision file in deps-packaging is generated: build-scripts/autogen Ticket: none Changelog: none Craigs-MacBook-Pro.local --- build-scripts/install-dependencies | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build-scripts/install-dependencies b/build-scripts/install-dependencies index 5c9e889bb..1d6558463 100755 --- a/build-scripts/install-dependencies +++ b/build-scripts/install-dependencies @@ -14,11 +14,11 @@ # # ^ When building community you won't need enterprise, nova. # -# The script can be run as follows: -# ``` -# $ PROJECT=[enterprise|community] EXPLICIT_ROLE=[hub|agent] BUILD_TYPE=[DEBUG|RELEASE] ./buildscripts/build-scripts/install-dependencies -# ``` -# +# The script can be run as described in the usage message below: + +usage() { + echo "Usage: PROJECT=[nova|community] EXPLICIT_ROLE=[hub|agent] BUILD_TYPE=[DEBUG|RELEASE] $0" +} . "$(dirname "$0")"/functions . detect-environment @@ -155,7 +155,9 @@ for dep in $DEPS; do tests=yes ;; *) - fatal "Unknown build type: $BUILD_TYPE" + log_error "Unknown build type: $BUILD_TYPE" + usage + exit 1 ;; esac @@ -171,6 +173,7 @@ for dep in $DEPS; do esac # Add $PREFIX to version of built dependencies so they get different package names and are distinguishable from each + # Note that this revision file is created by build-scripts/autogen revision=$(cat "$BASEDIR"/buildscripts/deps-packaging/revision) if [ "$BUILDPREFIX" != "/var/cfengine" ]; then safe_prefix="+$(echo "$PREFIX" | sed 's:/::g')"