mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
bbfdm: Support to handler vendor extensions
This commit is contained in:
parent
05b0f91ae0
commit
d51a6fe3c6
2 changed files with 21 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue