From: garciadeblas Date: Fri, 20 Sep 2019 10:47:13 +0000 (+0200) Subject: generate_descriptor_pkg.sh: improved detection of allowed files X-Git-Tag: v7.0.0rc1~58 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=0e5f5fe18d9d821ab018e4cb5708f567912af568;p=osm%2Fdevops.git generate_descriptor_pkg.sh: improved detection of allowed files This change introduces a new check for other allowed files, as long as its name is defined in ALLOWED_FILES_WILDCARDS. For instance, with this change, README can now be README.txt, README.md, README.rst, etc. Change-Id: Ia9a0bfb455b08fd5a8a924508f5611de57754454 Signed-off-by: garciadeblas --- diff --git a/descriptor-packages/tools/generate_descriptor_pkg.sh b/descriptor-packages/tools/generate_descriptor_pkg.sh index e14d4122..f54cd2c9 100755 --- a/descriptor-packages/tools/generate_descriptor_pkg.sh +++ b/descriptor-packages/tools/generate_descriptor_pkg.sh @@ -47,6 +47,7 @@ NSD_FOLDERS=(scripts charms icons ns_config vnf_config) # Other files allowed in the descriptor base directory ALLOWED_FILES=(README) +ALLOWED_FILES_WILDCARDS=(README) DESC_TYPES=(vnfd nsd) DESC_EXTN=(yml yaml json xml) @@ -756,7 +757,11 @@ if [ $CREATE == false ]; then for f in ${files[@]}; do if [ $(contains "${ALLOWED_FILES[@]}" $f) == "n" ]; then - echo "WARN: Unsupported file $f found" + for j in ${ALLOWED_FILES_WILDCARDS[@]}; do + if [[ $f != *"$j"* ]]; then + echo "WARN: Unsupported file $f found" + fi + done fi done