diff --git a/bbfdm/Makefile b/bbfdm/Makefile index 7d1eccaf7069ea55ca72ecb653a6cf73c3bbbe65..1eac19b5e9a967ee85cb0316e7775c8d02ae7422 100644 --- a/bbfdm/Makefile +++ b/bbfdm/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bbfdm -PKG_VERSION:=1.14.1 +PKG_VERSION:=1.14.2 USE_LOCAL:=0 ifneq ($(USE_LOCAL),1) diff --git a/bbfdm/tools/bbfdm.sh b/bbfdm/tools/bbfdm.sh index d7babb1d8261f1d2fc331a7dada659b9b6d84060..b8220c714022534452f872fccb404e53f3b7b189 100755 --- a/bbfdm/tools/bbfdm.sh +++ b/bbfdm/tools/bbfdm.sh @@ -9,10 +9,11 @@ SCRIPT=0 DIAG=0 PLUGIN=0 DEST="" +VENDOR_EXTN="" TOOLS="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" SRC="" -while getopts ":mpsdtu:" opt; do +while getopts ":mpsdtv:" opt; do case ${opt} in m) MICRO_SERVICE=1 @@ -29,6 +30,9 @@ while getopts ":mpsdtu:" opt; do t) INPUT_FILE=1 ;; + v) + VENDOR_EXTN=${OPTARG} + ;; ?) echo "Invalid option: ${OPTARG}" exit 1 @@ -88,6 +92,10 @@ bbfdm_install_dm() minfile=$(mktemp) jq -c 'del(..|.description?)' ${src} > ${minfile} + if [ -n "${VENDOR_EXTN}" ]; then + sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${minfile} + fi + src=${minfile} if dpkg -s python3-jsonschema >/dev/null 2>&1; then echo "Verifying bbfdm Datamodel JSON file" @@ -125,6 +133,7 @@ fi if [ "${INPUT_FILE}" -eq "1" ]; then + tempfile="" if [ ! -f "${SRC}" ]; then echo "# Datamodel Input file ${SRC} not available" exit 1 @@ -140,9 +149,18 @@ if [ "${INPUT_FILE}" -eq "1" ]; then exit 1 fi + tempfile=$(mktemp) + cp ${SRC} ${tempfile} + if [ -n "${VENDOR_EXTN}" ]; then + sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${tempfile} + fi install_dir ${DEST}/etc/bbfdm/services - install_data ${SRC} ${DEST}/etc/bbfdm/services/${DATA}.json + install_data ${tempfile} ${DEST}/etc/bbfdm/services/${DATA}.json + + if [ -f "${tempfile}" ]; then + rm ${tempfile} + fi exit 0 fi