2 # Copyright 2019 Whitestack LLC
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 . .
/util.bash
--source-only
24 echo "(pattern),(version),RO,devops,NBI,POL,LCM" &> statistics.txt
26 MODULES
=("RO" "devops" "NBI" "POL" "LCM")
28 grep -r --exclude=*.txt
$VNFD .
&>> search_results.txt
29 grep -r --exclude=*.txt
$NSD .
&>> search_results.txt
31 generateStatistics
(){ #1: $VNFD or $NSD, 2: commit tag
33 for i
in "${MODULES[@]}"
35 STATISTICS
="$STATISTICS,$(grep -F ./$i/ search_results.txt | grep $1 | wc -l)"
37 echo $STATISTICS &>>statistics.txt
40 generateStatistics
$VNFD "latest"
41 generateStatistics
$NSD "latest"
44 echo -e "${COLOR}-- Number of ocurrences of a pattern in each module for a specific version --"
46 printTable
',' "$(cat statistics.txt)" true