From 40906de55231891523a1039388a6fbef64b83fc4 Mon Sep 17 00:00:00 2001 From: DT Netsolution GmbH Date: Sat, 28 Jan 2012 10:27:46 +0100 Subject: [PATCH] remove DRYS --- lib/builder-targets.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/builder-targets.sh b/lib/builder-targets.sh index 3bd0069..2787202 100644 --- a/lib/builder-targets.sh +++ b/lib/builder-targets.sh @@ -14,15 +14,16 @@ builder_config() { builder_check_error "temp directory not available: $TMP_DIR" # Source product release configuration - test -f ${PRODUCT_DIR}/builder-product.cfg - builder_check_error "can't read release configuration: ${PRODUCT_DIR}/product.cfg" - . $PRODUCT_DIR/builder-product.cfg + local config=${PRODUCT_DIR}/builder-product.cfg + test -f ${config} || builder_check_error "can't read product config: ${config}" + . ${config} # set default build configuration and source the user dependent file . $BASEDIR/conf/opsi-builder.cfg # Source local build configuration (must be done AFTER sourcing the release.cfg) - test -f $HOME/.opsi-builder.cfg && . $HOME/.opsi-builder.cfg && echo "Loaded builder configuration: $HOME/.opsi-builder.cfg" + config=$HOME/.opsi-builder.cfg + test -f ${config} && . ${config} && echo "Loaded builder configuration: ${config}" test -f "$OPSI_BUILDER" && . $OPSI_BUILDER && echo "Loaded builder configuration: $OPSI_BUILDER" # Check variables